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

After calling window.open() useSelector stops working in Firefox #1921

Closed
1 task
marek-vele opened this issue May 19, 2022 · 3 comments
Closed
1 task

After calling window.open() useSelector stops working in Firefox #1921

marek-vele opened this issue May 19, 2022 · 3 comments

Comments

@marek-vele
Copy link

What version of React, ReactDOM/React Native, Redux, and React Redux are you using?

  • React: 18.1.0
  • ReactDOM/React Native: 18.1.0
  • Redux: 4.2.0
  • React Redux: 8.0.1

What is the current behavior?

After calling window.open() in a callback, useSelector in component isn't receiving updates from store any more, even though values in store are changed.
This only happens in Firefox and using "createRoot" from "react-dom/client" (in Chrome/Edge everything works ok).

https://codesandbox.io/s/nifty-mendel-5ucdij

What is the expected behavior?

Component keeps updating from store even after calling window.open();

Which browser and OS are affected by this issue?

Firefox 100.0.1, Windows 10

Did this work in previous versions of React Redux?

  • Yes
@timdorr
Copy link
Member

timdorr commented May 19, 2022

I'm pretty sure this has to do with your build setup in some way. I've tried this with some other code examples and window.open doesn't block further dispatches in Firefox.

@timdorr timdorr closed this as completed May 19, 2022
@Shrugsy
Copy link
Contributor

Shrugsy commented May 19, 2022

Just for a bit more info, this is reproducible on firefox in that build setup with plain setState, with redux completely stripped out. Seems unrelated to redux or react-redux

https://codesandbox.io/s/relaxed-river-u2o8r7?file=/src/App.js

@marek-vele
Copy link
Author

Thanks, it didn't occur to me trying to remove redux from the equation.
After more research I eventually found a probably related problem reported in react facebook/react#24458, which was fixed just a few days ago in react's main branch.
I tried my testcase with react@next and it seems to also fix this problem with firefox.

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

No branches or pull requests

3 participants