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

withFirebase.render - TypeError: Cannot read property 'dispatch' of undefined #591

Closed
savi2w opened this issue Dec 17, 2018 · 5 comments
Closed

Comments

@savi2w
Copy link

savi2w commented Dec 17, 2018

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Current Behaviour is we get an error "Cannot read property 'dispatch' of undefined" on using withFirebase in React Component.

If 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.

I just followed the "read me" from web-site adapting it to my boilerplate.
Clone here.

@prescottprue
Copy link
Owner

@weslenng Did you include the ReactReduxFirebaseProvider?

@savi2w
Copy link
Author

savi2w commented Dec 17, 2018

No, I'm using the react-redux Provider, same as the example given on the site.

@prescottprue
Copy link
Owner

prescottprue commented Dec 17, 2018

@weslenng What version are you using of react-redux and react-redux-firebase? If you are using a 2.*.* version of react-redux-firebase you need to also make sure to include the reactReduxFirebase store enhancer. Something to note though, this version only works with react-redux v5.

If you are using a v6.*.* version of react-redux, you will need to use a v3.*.* version of react-redux-firebase from the next tag/branch (as mentioned in the installation section of the main README). There is a different setup for the new version which includes a provider from react-redux-firebase.

@savi2w
Copy link
Author

savi2w commented Dec 17, 2018

I missed that detail, sorry.
Thank you for your help!

@savi2w savi2w closed this as completed Dec 17, 2018
@prescottprue
Copy link
Owner

@weslenng All good! Actually glad to know it happened to another person. I am going to look into adding a warning in the current version since you are not the first to have this happen.

@prescottprue prescottprue mentioned this issue Dec 17, 2018
3 tasks
prescottprue added a commit that referenced this issue Dec 17, 2018
* feat(HOCs): add error if using `react-redux@^6` (points to [v3 migration guide](http://docs.react-redux-firebase.com/history/v3.0.0/docs/v3-migration-guide.html)) - #591
* fix(docs): update react-native section of docs including broken links - #586
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

2 participants