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

semantic ui react dimmer warning finddomnode is deprecated in strictmode #4438

Closed
PTAHume opened this issue Sep 22, 2023 · 3 comments
Closed

Comments

@PTAHume
Copy link

PTAHume commented Sep 22, 2023

When I use Dimmer from semantic-ui-react I get this warning:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of RefFindNode which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node

But as I see the problem with Dimmer was resolved years before: link.

So what's the root of warring and how to avoid it (except to stop using strict mode)?

import React from "react";
import { Dimmer } from "semantic-ui-react";

const App = () => (
  <React.StrictMode>
    <Dimmer>Hey</Dimmer>
  </React.StrictMode>
);
export default App;

Example:
React 18.2.0, Semantic-ui-react 2.1.4 Link to codesandbox.io](https://codesandbox.io/s/dimmer-in-strictmode-react-18-2-0-forked-9jn3jn)

I am not the only one who has had this issue either : https://stackoverflow.com/questions/75694953/semant

@welcome
Copy link

welcome bot commented Sep 22, 2023

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@layershifter
Copy link
Member

Please try to use v3-beta (https://react.semantic-ui.com/migration-guide), it supports native ref forwarding.

@PTAHume
Copy link
Author

PTAHume commented Sep 24, 2023

thank you thats way better :)

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

2 participants