Skip to content

Warning : componentWillReceiveProps has been renamed, and is not recommended for use. #3745

Closed

Description

@ar5had

Hi,

I am getting this warning in console. I have installed the latest version ^3.0.4 of react-select along with ^3.0.4 of @types/react-select. The warning says that - Please update the following components: AutosizeInput, Select. I tried looking for componentWillReceiveProps method in the repo, but I couldn't find any file using it. Why am I getting this warning?

Activity

  1. dicrescenzoa commented on Aug 30, 2019

    @dicrescenzoa

    the same warning message is happening for jest as well.

    `console.warn node_modules/react-dom/cjs/react-dom.development.js:11494
    Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

      * Move data fetching code or side effects to componentDidUpdate.
      * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
      * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps 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: AutosizeInput, Select
    

    `

    package.json

    {
      "react": "^16.8.6"
      "jest": "^24.8.0",
      "react-select": "^3.0.4",
    }
  2. jarleriksen commented on Aug 31, 2019

    @jarleriksen

    Check #3720

  3. mreishus commented on Oct 24, 2019

    @mreishus

    Still getting warning messages as of 3.0.8. This will prevent the new react concurrent mode (not released yet) from working.

    To reproduce, wrap your app in <React.StrictMode></React.StrictMode> tags.

    Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details.
    
    * Move data fetching code or side effects to componentDidUpdate.
    * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
    
    Please update the following components: AutosizeInput, Select
    
  4. DalderupMaurice commented on Jan 3, 2020

    @DalderupMaurice

    Still getting warning messages as of 3.0.8. This will prevent the new react concurrent mode (not released yet) from working.

    To reproduce, wrap your app in <React.StrictMode></React.StrictMode> tags.

    Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details.
    
    * Move data fetching code or side effects to componentDidUpdate.
    * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
    
    Please update the following components: AutosizeInput, Select
    

    Same for me, wrapping it in StrictMode it is filled with warning.
    See my reply here for the exact warnings: #3751 (comment)

  5. makker commented on Apr 21, 2020

    @makker

    +1

  6. added
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 3, 2020
  7. bladey commented on Jun 18, 2020

    @bladey
    Contributor

    Hi all,

    Thank you to everyone who has provided information above.

    As you may be aware, this bug has been reported multiple times as per issue #4094. On behalf of the maintainers I apologise it's taken awhile to get to this.

    A new master issue #4094 has since been created to help keep track of this bug going forward.

    This new issue will exist as the source of truth going forward to investigate the issue, report findings, and implement a bug fix.

    We'll take into account all the details above while investigating.

    If you feel this issue has been wrongly closed as it isn't related to the new master issue #4094, please let us know and we'll take another look.

    Again, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions