Share state in top level React components
问题 I need to use react in different parts of my page but share the same state so I made this on the top level: ReactDOM.render( <App />, document.getElementById('root') ); ReactDOM.render( <Dragbar />, document.getElementById('offCanvas') ); The main code is "App" but how do I send state to "Dragbar"? (I only need to send it not set). Is this where I need to start learning redux etc? I've just started learning React so haven't looked at other libraries yet. P 回答1: working with redux can help you