useEffect in React not update component after update store
问题 I don't understand why React not update my object. In another component through the dispatch I update the state. In this (in code below) code in mapStateToProps categories are changing (console log show one more category). But component not rerender, although in component in useEffect I use props.categories. Event console.log in element does not run const LeftSidebar = (props: any) => { console.log('not render after props.categories changed') useEffect(() => { props.dispatch(getCategories())