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

redirect.js replace UNSAFE_componentWillMount with componentDidMount #266

Open
orenklein opened this issue Jun 8, 2020 · 6 comments
Open

Comments

@orenklein
Copy link

Any reason not to replace UNSAFE_componentWillMount with componentDidMount?

@ashishnumino
Copy link

Even I am facing same issue? Any timelines to fix this issue?

@zakriabilal
Copy link

Getting the same issue over here.

Any possible quick fixes that can be implemented?

@janoist1
Copy link

+1

@mjrussell mjrussell reopened this Mar 21, 2021
@mjrussell
Copy link
Owner

Oops misread at first.

Why does this need a fix? The behavior is different between the two. Feel free to try a PR but I think you'll find out why its important to use WillMount instead of DidMount

@jlimas
Copy link

jlimas commented May 16, 2021

It's because of this warning when using this library @mjrussell I have a fresh React installation only with this library and started getting this warnings on dev tools.

Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.

Please update the following components: Redirect

@mjrussell
Copy link
Owner

As I said earlier. I'm not sure I can maintain the same behavior/invariants but I welcome a PR that passes the test suite.

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

6 participants