Redux 4.0 - Unable to access updated data using useSelector
mert6107 opened this issue · comments
I'm using redux:4.2.1 - redux-saga:1.2.3 react-redux:8.0.5 .
I tried to use sage with basic tutorial in other project except my own project but I got same bug . I'm fetching data with Axios in redux side. Then I'm trying to fetch in component side with useSelector. But I get initialStates data when I refresh the page. But if I use to hot reload ,goes to previous page and come back again , data come in . I checked Network. if I refresh the page, data coming in Network. But I can't see it in console or can't pushing it in state in components.
Basically I use this code in components :
useEffect(()=>{ dispatch(myAction) console.log('test',selectorData) }, [dispatch])
Greetings! Do you have a codesandbox with the issue that I would see? It's hard to know what's going on without viewing all the code.
Unfortunately, I tried two different basic tutorial. I'm wondering if it's a version bug or something.