You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The child component can invoke the event handler received from the parent to inform the parent that a certain action took place, such as when the child component receives a click event or, in a visibility handler, when it becomes visible. The following code provides an example.
22
+
The child component can invoke the lambda received from the parent to inform the parent that a certain action took place, such as when the child component receives a click event or, in a visibility handler, when it becomes visible. The following code provides an example.
There are cases when a parent needs to trigger an action on a child instead of just passing new data. To do this, the parent can interact with the child using controllers (see [Controllers Pattern](/docs/mainconcepts/primitivecomponents/primitive-controllers/)),
40
40
which the parent creates and passes to the child component as a prop:
Copy file name to clipboardExpand all lines: sample/src/main/java/com/facebook/samples/litho/java/communicating/ChildComponentReceivesEventFromParentComponent.kt
Copy file name to clipboardExpand all lines: sample/src/main/java/com/facebook/samples/litho/java/communicating/ChildComponentSendsEventToParentComponent.kt
Copy file name to clipboardExpand all lines: sample/src/main/java/com/facebook/samples/litho/java/communicating/ChildComponentSiblingCommunicationComponent.kt
Copy file name to clipboardExpand all lines: sample/src/main/java/com/facebook/samples/litho/java/communicating/ParentComponentReceivesEventFromChildComponent.kt
Copy file name to clipboardExpand all lines: sample/src/main/java/com/facebook/samples/litho/java/communicating/ParentComponentSendsEventToChildComponent.kt
0 commit comments