There are 8 types of communication in ReactJs with use of plain JS or simple React Concepts. In this document you can find the sample code for all of this types of communication.
Types of Communication flows covered :
-
Parent to Child
- Props
branch : parentToChild__props
- Instance methods
branch : parentToChild__instanceMethods
- Props
-
Child to parent
- Call Back
branch : childToParent__Callback
- Event Bubbling
branch : childToParent__eventBubbling
- Call Back
-
Sibling to sibling (Via parent Component)
branch : siblingToSibling
-
Any to Any
- Observer Patterns
branch :
- Global Variables
branch :
- Context
branch :
- Observer Patterns
Raise a PR if you want to correct or Suggest, Thanks
Clone or Download the repo, goto the root folder and type
npm install
and after installation type
npm start
open http://localhost:3000