Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in react-hotkeys when using React's strict mode #128

Closed
edmorley opened this issue Nov 9, 2018 · 4 comments
Closed

Warnings in react-hotkeys when using React's strict mode #128

edmorley opened this issue Nov 9, 2018 · 4 comments

Comments

@edmorley
Copy link

edmorley commented Nov 9, 2018

Hi!

React 16.3 added a new strict mode, which highlights potential issues in an app (such as those that will cause problems when using the upcoming async mode):
https://reactjs.org/docs/strict-mode.html

Enabling it for our app resulted in several errors coming from react-hotkeys:

Warning: Unsafe lifecycle methods were found within a strict-mode tree:
    in StrictMode (at job-view/index.jsx:28)

componentWillMount: Please update the following components to use componentDidMount instead: 
HotKeys

-> see: https://reactjs.org/docs/strict-mode.html#identifying-unsafe-lifecycles

Warning: Legacy context API has been detected within a strict-mode tree: 
    in StrictMode (at job-view/index.jsx:28)

Please update the following components: HotKeys

-> see: https://reactjs.org/docs/strict-mode.html#detecting-legacy-context-api

Warning: findDOMNode is deprecated in StrictMode.
findDOMNode was passed an instance of HotKeys which is inside StrictMode.
Instead, add a ref directly to the element you want to reference.

    in div (created by FocusTrap)
    in FocusTrap (created by HotKeys)
    ...

-> see: https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage

Many thanks :-)

@greena13
Copy link
Owner

greena13 commented Jan 10, 2019

This will be fixed in v2.0.0-pre1 when it's released.

@edmorley
Copy link
Author

Many thanks!

@ndelangen
Copy link

I'm using v2.0.0-pre4

I'm still getting this warning:

vendors~main.64d108ae760cbd63d1ea.bundle.js:138014 Warning: Legacy context API has been detected within a strict-mode tree: 
    in StrictMode

Please update the following components: GlobalHotKeys

Learn more about this warning here:
https://fb.me/react-strict-mode-warnings

@greena13
Copy link
Owner

greena13 commented Mar 6, 2019

Hi @ndelangen, thanks for making me aware. I have created a separate issue to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants