Expected instance props to match memoized props in React 16

Viewed 3360

I am upgrading from react version 15 to 16 (16.6.1) and I am seeing this warning a bunch in the console, should I be worried?

Warning: Expected instance props to match memoized props before componentDidUpdate. This is likely due to a bug in React. Please file an issue.

I can't really file an issue because I can't pinpoint it and it's not my code to share. I can't find anything online about this issue.

Should I be worried? Should I just let it slip?

2 Answers

Looking at a reproducing case in this issue report, this happens because a particular library (in that example, react-css-modules) overwrites the this.props object in your React component.

This has never been supported and can lead to other issues. If you must rely on this, a possible workaround is described here.

it took me days to solved. The issue was this.state was my local variable ref for address field.

ref={ref => (this.state = ref)} // error line

Related