Answer the question
In order to leave comments, you need to log in
How to send events to components inside other components?
If there are two components that are placed in one common - understandable.
Example But what if
the component <Bbutton/>
is inside
but inside ?
Then they somehow meet in the main App component.
How to synchronize them? Somehow through {...this.props} and conditions to write also in the App? <Header/>
<Popup/>
<MainSection/>
Answer the question
In order to leave comments, you need to log in
in general terms, something like this:
https://gist.github.com/edtoken/d0909e9f57070376b58a
Layout has a state, state stores what all child components from Layout need.
(actually as well as with any other component).
Layout also has methods for working with state and provides them to child components from itself.
Any other child component has its own handlers, modifies / receives / calculates data and uses the method that was passed from Layout
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question