Skip to content

findDOMNode is deprecated in StrictMode #3810

Closed
@gshilin

Description

@gshilin

Bug Report

Steps

import React, { StrictMode } from 'react'
import { Button } from 'semantic-ui-react'

const ButtonExampleButton = () => 
  <StrictMode>
    <Button as="a" href="https://google.com">
      Click Here
    </Button>
  </StrictMode>

export default ButtonExampleButton

Expected Result

No warnings

Actual Result

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://fb.me/react-strict-mode-find-node
in a (created by Button)
in RefFindNode (created by Ref)
in Ref (created by Button)
in Button (at example.js:6)
in StrictMode (at example.js:5)
in ButtonExampleButton

Version

0.88.0

Testcase

https://codesandbox.io/s/semantic-ui-react-1qmyh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions