haxe-react icon indicating copy to clipboard operation
haxe-react copied to clipboard

Add compilation error when mixing component lifecycle methods

Open kLabz opened this issue 6 years ago • 0 comments

React will give the following runtime error:

Warning: Unsafe legacy lifecycles will not be called for components using new component APIs.

MyComponent uses getDerivedStateFromProps() but also contains the following legacy lifecycles:
  componentWillMount

The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-unsafe-component-lifecycles

These could (and should) be catched at compile time.

kLabz avatar Nov 28 '19 11:11 kLabz