I have one component of App.js where I am trying to save state using redux . In index.js, where I install the repository only for the <App /> component.
index.js
let store = createStore(scoreReducer); ReactDOM.render( <Provider store={store}><App /></Provider>, document.getElementById("root") ); registerServiceWorker();
I have this method in App.js to display the state in the details available inside App.js
App.js
function mapStateToProps(state) { return { score: state.score, status: state.status }; }
Everything is fine so far, now I'm not sure how to access { this.props.score} in another component?
What changes do I need to make in index.js and the second component if I want to access {this.props.score} in another component?
reactjs redux react-redux
N sharma
source share