question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react > 16 deprecated lifecycles

See original GitHub issue

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: Formsy(TextFieldFormsy)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
rkuykendallcommented, Jan 4, 2020

This has been fixed in the 2.x beta releases, which should be released in the coming week / weeks. 😃

1reaction
rkuykendallcommented, Feb 3, 2020

This has been fixed in the new 2.0.0 release. Thank you all for your patience! 🎉

Please re-open this ticket or create a new one if I am mistaken.

v2.0.0

  • Much, much faster
  • Many, many bug fixes
  • Full Typescript typing
  • Fixed deprecated lifecycle methods
  • Updated all libraries
  • Fixed a number of legacy decisions in the Formsy API, mostly a reliance on function props over value props passed down to wrapped components. However, the API changes are minor and listed below:
    • getErrorMessage() => errorMessage
    • getErrorMessages() => errorMessages
    • getValue() => value hasValue() => hasValue
    • isFormDisabled(): => isFormDisabled
    • isFormSubmitted() => isFormSubmitted
    • isPristine() => isPristine
    • isRequired() => isRequired
    • isValid(): => isValid
    • showError() => showError
    • showRequired() => showRequired

https://github.com/formsy/formsy-react/compare/v1.1.4...v2.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding React v16.4+ New Component Lifecycle ...
In React 16.3 few lifecycle methods have been deprecated. For now, these methods are prefixed with UNSAFE_ and will be fully removed in...
Read more >
React v16.9.0 and the Roadmap Update
Deprecate old names for the UNSAFE_* lifecycle methods. · Deprecate javascript: URLs as a common attack surface. · Deprecate uncommon “module ...
Read more >
Lifecycle deprecated/New Methods - React Training
deprecated — componentWillReceiveProps(nextProps) ... This function will be called in each update life-cycle caused by changes to props (parent component re- ...
Read more >
React: componentWillMount to be deprecated! - Northcoders
React : componentWillMount to be deprecated! · All three methods are frequently use incorrectly and there are better alternatives. · When asynchronous rendering...
Read more >
Explain new lifecycle methods in React v16.3 - GeeksforGeeks
These lifecycle methods were often misused (like in-state updates). So, these lifecycles are deprecating unsafe lifecycles in which they add the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found