File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -267,8 +267,8 @@ export default function connectAdvanced(
267
267
268
268
if ( prefixUnsafeLifecycleMethods ) {
269
269
// Use UNSAFE_ event name where supported
270
- Connect . UNSAFE_componentWillReceiveProps = Connect . componentWillReceiveProps
271
- delete Connect . componentWillReceiveProps
270
+ Connect . prototype . UNSAFE_componentWillReceiveProps = Connect . prototype . componentWillReceiveProps
271
+ delete Connect . prototype . componentWillReceiveProps
272
272
}
273
273
274
274
/* eslint-enable react/no-deprecated */
@@ -280,7 +280,9 @@ export default function connectAdvanced(
280
280
Connect . propTypes = contextTypes
281
281
282
282
if ( process . env . NODE_ENV !== 'production' ) {
283
- Connect . prototype . componentWillUpdate = function componentWillUpdate ( ) {
283
+ // Use UNSAFE_ event name where supported
284
+ const eventName = prefixUnsafeLifecycleMethods ? 'UNSAFE_componentWillUpdate' : 'componentWillUpdate' ;
285
+ Connect . prototype [ eventName ] = function componentWillUpdate ( ) {
284
286
// We are hot reloading!
285
287
if ( this . version !== version ) {
286
288
this . version = version
You can’t perform that action at this time.
0 commit comments