admin管理员组

文章数量:1410688

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 ponentDidUpdate. 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?

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 ponentDidUpdate. 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?

Share Improve this question asked Nov 13, 2018 at 2:26 Adam ThompsonAdam Thompson 3,5264 gold badges28 silver badges46 bronze badges 2
  • Can you post some sample code? Or at least provide an example that triggers the same warning. – Matt Carlotta Commented Nov 13, 2018 at 2:56
  • @mattcarlotta I can I can reproducing warning, see my ment on github issues – Roy Commented Nov 14, 2018 at 14:43
Add a ment  | 

2 Answers 2

Reset to default 5

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

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

本文标签: javascriptExpected instance props to match memoized props in React 16Stack Overflow