My structure looks like below. I need to read props of component1 from component5. How to make it? Thanks.
Component 1
|- Component 2
|- Component 4
|- Component 5
My structure looks like below. I need to read props of component1 from component5. How to make it? Thanks.
Component 1
|- Component 2
|- Component 4
|- Component 5
You can use context in react or redux
Context: https://reactjs.org/docs/context.html
And redux library: https://redux.js.org/
You have two main options here:
And the difference as per requirement you can choose Context or Redux to use