Skip to content

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. #3915

Closed

Description

@mikayelzarafyan

react-dom.development.js:530 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

Activity

  1. maximilianschmidt commented on Mar 25, 2020

    @maximilianschmidt

    same error with 3.1.0 for me:

    Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code

  2. lucasltv commented on Apr 1, 2020

    @lucasltv

    For me too! Same warning...

  3. JoeGreen1982 commented on Apr 2, 2020

    @JoeGreen1982

    Also getting the same error in 3.1.0....

  4. codewhynot commented on Apr 7, 2020

    @codewhynot

    The same error in 3.1.0

  5. 0xdevalias commented on Apr 22, 2020

    @0xdevalias
  6. added
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 1, 2020
  7. added
    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainer
    and removed
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 11, 2020
  8. giacintayao commented on Jun 12, 2020

    @giacintayao

    I'm getting an error, not just a warning.
    index.js:1 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

  9. gempain commented on Jun 15, 2020

    @gempain

    In addition to the above, I am getting this one after I start selecting something:

    index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of NodeResolver which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node
        in div (created by Context.Consumer)
        in EmotionCssPropInternal (created by MenuList)
        in MenuList (created by MenuPlacer)
        in ScrollBlock (created by MenuPlacer)
        in NodeResolver (created by ScrollCaptor)
        in ScrollCaptor (created by ScrollCaptorSwitch)
        in ScrollCaptorSwitch (created by MenuPlacer)
        in div (created by Context.Consumer)
        in EmotionCssPropInternal (created by Menu)
        in Menu (created by MenuPlacer)
        in MenuPlacer (created by Select)
        in div (created by Context.Consumer)
        in EmotionCssPropInternal (created by SelectContainer)
        in SelectContainer (created by Select)
        in Select (created by StateManager)
    
  10. 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.

  11. JanaSundar commented on Aug 12, 2020

    @JanaSundar

    Screenshot from 2020-08-12 16-37-21
    In version 3.1.0 this warning is shown

  12. Methuselah96 commented on Aug 12, 2020

    @Methuselah96
    Collaborator

    @JanaSundar Follow #4094 to get the latest updates on this issue.

  13. junreyd commented on Sep 1, 2020

    @junreyd

    Any updates for this bugs?

  14. golendercaria commented on Dec 12, 2020

    @golendercaria

    I've already bug in new blank project.

    
    * 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://reactjs.org/link/derived-state
    
    Please update the following components: AutosizeInput, Select```
    
  15. ebonow commented on Dec 12, 2020

    @ebonow
    Collaborator

    @junreyd and @golendercaria

    Regarding an update on this, fixes for these issues are a priority. We've identified and resolved these (thanks to @Methuselah96) in the least intrusive ways possible, and are preparing a new release likely within the next week or two. You can read more about it here. #4293 (comment)

  16. fadzrinmadu commented on Apr 23, 2021

    @fadzrinmadu

    anyone can help me, I got this error too

  17. ebonow commented on Apr 23, 2021

    @ebonow
    Collaborator

    Greetings @fadzrinmadu ,

    This issue was closed with the release of version 4. Can you please confirm which version of react-select you are using?

  18. shopglobal commented on Apr 28, 2023

    @shopglobal

    for me it's a react 18 dependency mismatch, it could be anything. Update depends in your package.json

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-confirmedIssues about a bug that has been confirmed by a maintainer

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions