-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Use UNSAFE_ lifecycle event names where supported. #1383
Conversation
Any thoughts on this approach vs remix-run/react-router#6883? |
This provides forward compatibility with React 17.x for those still using the react-redux 5.x series by detecting support for the UNSAFE_ prefixed lifecycle event names (using `React.createContext` as a feature check as it avoids semver checking but was introduced in React 16.3 at the same time as the UNSAFE_ prefixes).
@timdorr this has been updated to be consistent with the implementation in remix-run/react-router#6883 (using |
The various failures don't appear to be related to the changes in this PR. |
@timdorr any interest in merging this? Essentially the same fix as the merged version in remix-run/react-router#6883 |
Yep, sorry, I've been distracted. |
No worries at all, thanks this this!
…On Wed, 28 Aug 2019, 23:55 Tim Dorr, ***@***.***> wrote:
Merged #1383 <#1383> into 5.x.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1383?email_source=notifications&email_token=AADDR7QZPJ4NVYR4MSANGI3QGZ7VTA5CNFSM4IOO5QXKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTJU6QLQ#event-2590631982>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADDR7UYNFCTK2RPM7CAAWLQGZ7VTANCNFSM4IOO5QXA>
.
|
When you get time, a patch release for 5.x would be handy :) |
Same would love a release for this as well |
@timdorr |
import PropTypes from 'prop-types' | ||
import { storeShape, subscriptionShape } from '../utils/PropTypes' | ||
import warning from '../utils/warning' | ||
|
||
const prefixUnsafeLifecycleMethods = parseFloat(React.version) >= 16.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's not good... Can you work up a fix PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I got it: #1407
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, we've gone back to a feature check like this PR originally shipped with before #1383 (comment) :D Thanks for the pick up Sam.
This provides forward compatibility with React 17.x for those still
using the react-redux 5.x series by detecting support for the UNSAFE_
prefixed lifecycle event names (using
React.createContext
as a featurecheck as it avoids semver checking but was introduced in React 16.3 at
the same time as the UNSAFE_ prefixes).
See discussion on #1374 for context.