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

React 16.3 componentWillMount #89

Closed
patrick-jones opened this issue Jul 13, 2018 · 1 comment
Closed

React 16.3 componentWillMount #89

patrick-jones opened this issue Jul 13, 2018 · 1 comment

Comments

@patrick-jones
Copy link
Contributor

componentWillMount has been deprecated as of React 16.3. Because kea injects its own componentWillMount, React produces warnings if I kea-fy a component that uses the new lifecycle:

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

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

The above lifecycles should be removed.
@patrick-jones
Copy link
Contributor Author

Looking at the code, all the injected componentWillMount does is map this.actions to this.props.actions. Perhaps this could be replaced with a getter, which would offer the same convenience without interfering with the react lifecycle methods.

If this seems like a valid approach I can PR it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant