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

bug(HOCs): use of componentWillReceiveProps in HOCs cause warnings with 16.9.0 #755

Closed
shevchenko0 opened this issue Aug 27, 2019 · 7 comments
Labels
Milestone

Comments

@shevchenko0
Copy link

Bug report

Steps

Use firestoreConnect with [email protected] and [email protected]
Open your console to see the warnings

Expected Result

No warnings should appear

Actual Result

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: FirestoreConnectWrapped(Connect(withI18nextTranslation(TranscriptsList)))

Version

3.0.0-alpha.16

@prescottprue prescottprue changed the title Warnings about lifecycle methods fix(HOCs): update componentWillReceiveProps to componentDidUpdate to prevent warnings with 16.9.0 Aug 27, 2019
@prescottprue prescottprue changed the title fix(HOCs): update componentWillReceiveProps to componentDidUpdate to prevent warnings with 16.9.0 bug(HOCs): use of componentWillReceiveProps in HOCs cause warnings with 16.9.0 Aug 27, 2019
@prescottprue prescottprue added this to the v3.0.* milestone Aug 27, 2019
prescottprue pushed a commit that referenced this issue Sep 6, 2019
…HOCs to prevent warnings with 16.9.0 - #755

fix(docs): update client side role assign example in roles recipes - #699
fix(docs): add example for assigning role in cloud function - #699
@prescottprue prescottprue mentioned this issue Sep 6, 2019
3 tasks
prescottprue added a commit that referenced this issue Sep 6, 2019
* feat(auth): remove `signIn` option from createUser (new user is automatically signed in through Firebase SDK) - #513
* feat(core): new pattern for getting extended firebase instance in thunks (added back `getFirebase` to api) - #635
* fix(HOCs): switch to `UNSAFE_componentWillReceiveProps` in class based HOCs to prevent warnings with 16.9.0 - #755
* fix(HOCs): switch `withFirebase` and `withFirestore` back to pre-hooks compatible logic
* fix(core): replace lodash methods such as `isArray`, `isBoolean`, `isString`, `size`, `compact` and `isFunction` with native methods in a number of places
* chore(deps): update lodash to 4.17.15
* chore(docs): add docs for how to reference data from state for reselect selectors - #614
* chore(docs): update client side role assign example in roles recipes - #699
* chore(docs): add example for assigning role in cloud function - #699
@prescottprue
Copy link
Owner

Wasn't able to go straight to componentDidUpdate, but that will most likely happen in the future to support v17 of react.

The warning is fixed in the v3.0.0-beta release.

@s4ek1389
Copy link

@prescottprue Still getting this warning when using Strict Mode in react: 17.0.1 and react-redux-firebase 3.7.0. Is there a way to fix it?

@prescottprue
Copy link
Owner

@s4ek1389 Can you open a new issue with the warning so we don't loose track

@LuisMerinoP
Copy link

LuisMerinoP commented Jan 24, 2021

I am getting the warning with "react": "^17.0.1" and "react-redux-firebase": "^3.10.0". I opened an issue.
This is the code producing the warning:

[export default compose<React.FunctionComponent>(
  connect(mapStateToProps),
  firestoreConnect([
    { collection: 'projects' }
  ])
)(Dashboard);

@nicholas919
Copy link

any updates on this issue? i'm getting same warning too

@LuisMerinoP
Copy link

no updates. I opened a new issue for this warning. Seems that you should live with it until the HOC is fixed, or use react hooks to link your component to firestore to get rid of the warning

@nicholas919
Copy link

great.. thanks for the advice @LuisMerinoP but i think im done with this, the documentation won't help much and still.. errors were keep appear on my console... it would be great to create my own npm package

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

5 participants