We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
React version: 18.2.0
If I dipatch a AsyncThunk in useEffect ,can I use the latest state in the useEffect function immediately ?
Link to code example:
const user = useAppSelector((store) => store.user,shallowEqual); useEffect(() => { ()=>{ dispatch(load()).then(() => { console.log(user);} }, []);
The text was updated successfully, but these errors were encountered:
project is dead, just forget :D
Sorry, something went wrong.
No branches or pull requests
React version: 18.2.0
Steps To Reproduce
If I dipatch a AsyncThunk in useEffect ,can I use the latest state in the useEffect function immediately ?
Link to code example:
const user = useAppSelector((store) => store.user,shallowEqual);
useEffect(() => {
()=>{
dispatch(load()).then(() => {
console.log(user);}
}, []);
The text was updated successfully, but these errors were encountered: