Skip to content
Advertisement

Fixing ‘index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code’ in react

I have this higher order component which recieve a comp of volunteer for ex and an action, and then render a table with the volunteer info: the volunteer comp code:

JavaScript

and the HOC code is:

JavaScript

it works fine but i am getting this warning: enter image description here

There are similiar question about this , but did not find the solution there, also i have tied to implement componentDidUpdate but it fails. is there a problem by using componentDidMount life cycle?

Edit: the DataProvider, FilterProvider or SortProvider, the components that mentioned in the message, comes from the react-bootstrap-table-2 comp:

JavaScript

here is a picture of the components list: enter image description here

Advertisement

Answer

This is a known problem in react-bootstrap-table-2 component and has nothing to do with the HOC code you’ve pasted.

Your options are:

  • ignore the warning and hope nothing breaks
  • do the work to fix the library for more modern React and maybe put in a PR – wait for someone else to do the work
  • switch to another library
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement