Skip to content

React 18 Strict mode warning: "Using UNSAFE_xxxxx in strict mode is not recommended and may indicate bugs in your code." #618

@salehmdev

Description

@salehmdev

Describe the bug
When upgrading to React 18, 2 warnings in the console seem to be caused by this package while using Strict mode. From personal usage, the warnings that I see are:

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

To Reproduce

Expected behavior

  • Support for strict mode in React 18+.
  • No errors/warnings showing up in the console when on React version 18+.

Screenshots
image

Environment (please complete the following information):

  • Browser: Firefox & Chrome
  • OS: Windows

Additional context

  • The origin of this warning message was difficult to diagnose since the warning doesn't mention what exact component the warning is coming from (as you can see from the screenshot). After scouring google search and checking all dependencies, I think I found a relevant issue in this package that might be directly related.
    • Issue Feat: React 18 support? #560
      • PS - thank you for providing the React 18 support!
    • There are a few cases of using those UNSAFE_ .. methods in the project, probably not just from this issue.

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