-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
bug(firebaseConnect): react-router race condition #463
Comments
@garyforsterio Thanks for reporting, this is an interesting case! I agree with the Interested if Totally open to a pull request if you have the time. If not I'll try to get to it as soon as I can. |
I faced the same issue. It seems that we should replace Do we have some another reason why Meanwhile, as a temporary workaround I've used |
@cryser29 Thanks for the input and ideas for work arounds! I would be interested to see what is impacted by this change. Some folks may be depending on this order, so it may warrant v3. |
I was going to have a look at implementing the |
@cryser29 thanks.
|
Hey Guys, Any news with that? got the same issue + the workaround didn't help so I have to use the following workaround: |
Any news with that one? |
* feat(firebaseConnect): HOCs switched to componentDidMount in place of componentWillMount - #463 * feat(deps): update hoist-non-react-statics to 3.0.1 * fix(deps): remove gitbook-cli from dev dependencies (not used)
@yevgenypats Due to the potential impact, work on this will go into the next major version. I started working on it on the v3.0.0-alpha branch. There may be a bunch of other big changes, so more updates to come about timelines. As mentioned above, anyone experiencing this should use a unique storeAs: `project_${props.params.projectId}` |
Do you want to request a feature or report a bug?
bug
(If this is a usage question, please do not post it here—post it on gitter. If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
What is the current behavior?
When transitioning between two components using react-router, the new component is mounted before the existing component is unmounted. Consequently,
firebaseConnect()
creates a listener before the old one has been detached. This in most cases is fine, however in my specific case, both components are subscribing to the same firebase path (albeit with different query parameters) which doesn't work. The way that listeners are currently detached (see here), means that both the new and the old listeners aredetached.
This if statement does not catch this edge case as my query parameters are different.
I think this could be overcome by passing the listener to
off(listener)
as documented hereIf the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.
What is the expected behavior?
The second component continues to receive data from firebase after the first component has unmounted.
Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
The text was updated successfully, but these errors were encountered: