Hi,
Please tell me how I can call the “state” of the first component(Editor) into the second one(Previewer)? so that the Previewer changes as I type into the Editor.
Hi,
Please tell me how I can call the “state” of the first component(Editor) into the second one(Previewer)? so that the Previewer changes as I type into the Editor.
If previewer is a child of editor you can pass down state of previewer to the child editor through props, it will cause a rerender whenver state or props change.
Another way you can do it is if they are siblings, then you will raise the state of editor to a parent i.e. App component for example and they both can share it.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.