Skip to content

Warning: componentWillMount has been renamed, and is not recommended for use #331

@davefollett

Description

@davefollett

The following warning is outputted in the browser console when running locally.

react-dom.development.js:12386 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: ConnectedRouter, Route, Router, Styled(Connect(withRouter(Search))), Styled(Header), Styled(Logo), Styled(Queue), styled.div, styled.h1, styled.main, styled.ul

👣 Steps to reproduce

  1. Run the website in local development mode:
  • cd website
  • npm start
  1. Inspect main page (control+shift+i)
  2. Select the console tab

🔬 Expected behavior

No warnings of this type.

🌳 Environments

🖥 Desktop

  • OS: Ubuntu 18.04 LTS
  • Browser: Google Chrome
  • Version: 77.0.3865.120 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions