I'm trying to learn redux and implementing it in react without react-redux. Why you ask? just want to learn vanilla redux. so I use this approach:
const render = () => ReactDOM.render(<App />, document.getElementById("root"));
store.subscribe(render);
render();
Now the redux store listens for a dispatch and runs the render callback on every single change. The problem is that all the components in the app will be rendered when a change to the store occurs,because we subscribe the root element. I want only the the relevant components(the components that actually use the state in the store that changed) to be rendered. Is there a way to do it only with "redux" without "react-redux"?
thanks.