Skip to content

Warning: findDOMNode is deprecated in StrictMode. #345

Closed
@viclafouch

Description

@viclafouch

Expected Behavior

I've just installed Notistack on my project in React 17. I followed the Getting Started and got this warning/error:

index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here:.

I would like to avoid removing the Strict Mode.

image

Steps to Reproduce

  • Use Notistack in React 17 and Strict Mode.
<React.StrictMode>
  <SnackbarProvider>
    <App />
  <SnackbarProvider>
</React.StrictMode>
  • Enqueue a notification
enqueueSnackbar('Erreur', {
  variant: 'error'
})

Context

Your Environment

Tech Version
Notistack v1.0.3
React 17.0.1
Browser Chrome Version 87.0.4280.88 (Build officiel) (x86_64)
etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions