Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Components communication approch

1. parent to child communication


2. child to parent communication
3. sibling componeneet communication using pubsub
4. communication across vf page, aura and lwc using lightning message service (LMS)

parent to child communication or child to parent communication we need to pass


@api decorator

1. to makee a field/ property or method public , decorator it with @api decorator


2. when we want to expose the property we decorate the field with @api
3. an owner component that use the coponenet in its html markup can acess
the component's public properties via HTML attribute
4. public properties are also reactive in nature and if the value of the property
change the component's template re-renders.

case1

parent component -> passing primitive date to child -> child component

case 2

parent component -> passing non-primitive data to child -> child component

// non primitive datatype


array, object

case 3
passing data to child on action at parent component
parent component -> passing data to child on action at parent component -> child
component

You might also like