Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redux 4.0 - Unable to access updated data using useSelector #2379

Open
mert6107 opened this issue May 26, 2023 · 2 comments
Open

Redux 4.0 - Unable to access updated data using useSelector #2379

mert6107 opened this issue May 26, 2023 · 2 comments
Labels

Comments

@mert6107
Copy link

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])

@neurosnap
Copy link
Member

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.

@mert6107
Copy link
Author

mert6107 commented Jun 1, 2023

Unfortunately, I tried two different basic tutorial. I'm wondering if it's a version bug or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants