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

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

Closed
salehmdev opened this issue Feb 9, 2023 · 3 comments
Labels

Comments

@salehmdev
Copy link

salehmdev commented Feb 9, 2023

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.
@StephaneIzi
Copy link

Yeah, i still have the exact same problem

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@mark-codylor
Copy link

Same issue here

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

No branches or pull requests

3 participants