react-select icon indicating copy to clipboard operation
react-select copied to clipboard

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

Open mikayelzarafyan opened this issue 6 years ago • 16 comments

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

mikayelzarafyan avatar Jan 30 '20 14:01 mikayelzarafyan

same error with 3.1.0 for me:

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

maximilianschmidt avatar Mar 25 '20 11:03 maximilianschmidt

For me too! Same warning...

lucasltv avatar Apr 01 '20 23:04 lucasltv

Also getting the same error in 3.1.0....

JoeGreen1982 avatar Apr 02 '20 15:04 JoeGreen1982

The same error in 3.1.0

codewhynot avatar Apr 07 '20 15:04 codewhynot

See also:

  • UNSAFE_componentWillReceiveProps
    • https://github.com/JedWatson/react-select/issues/3720
    • https://github.com/JedWatson/react-select/issues/3745
    • https://github.com/JedWatson/react-select/issues/3751
  • Legacy context API: MenuPlacer
    • https://github.com/JedWatson/react-select/issues/3703
    • https://github.com/JedWatson/react-select/issues/3916
    • https://github.com/JedWatson/react-select/pull/3928

https://github.com/JedWatson/react-select/issues/3720#issuecomment-616069515

@razh There is currently a rewrite in progress to remove these deprecated lifecycle methods.

0xdevalias avatar Apr 22 '20 03:04 0xdevalias

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

giacintayao avatar Jun 12 '20 18:06 giacintayao

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)

gempain avatar Jun 15 '20 11:06 gempain

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.

bladey avatar Jun 18 '20 06:06 bladey

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

JanaSundar avatar Aug 12 '20 11:08 JanaSundar

@JanaSundar Follow https://github.com/JedWatson/react-select/issues/4094 to get the latest updates on this issue.

Methuselah96 avatar Aug 12 '20 12:08 Methuselah96

Any updates for this bugs?

junreyd avatar Sep 01 '20 15:09 junreyd

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```

golendercaria avatar Dec 12 '20 15:12 golendercaria

@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. https://github.com/JedWatson/react-select/issues/4293#issuecomment-743781662

ebonow avatar Dec 12 '20 16:12 ebonow

anyone can help me, I got this error too

fadzrinmadu avatar Apr 23 '21 12:04 fadzrinmadu

Greetings @fadzrinmadu ,

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

ebonow avatar Apr 23 '21 16:04 ebonow

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

shopglobal avatar Apr 28 '23 23:04 shopglobal