Skip to content

Commit

Permalink
fix feature detection for deprecated lifecycles (#6961)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryqdineen authored and timdorr committed Oct 3, 2019
1 parent ee4fcff commit 3865afe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/ContextUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function makeContextName(name) {
return `@@contextSubscriber/${name}`
}

const prefixUnsafeLifecycleMethods = parseFloat(React.version) >= 16.3
const prefixUnsafeLifecycleMethods = typeof React.forwardRef !== 'undefined'

export function ContextProvider(name) {
const contextName = makeContextName(name)
Expand Down
2 changes: 1 addition & 1 deletion modules/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const propTypes = {
matchContext: object
}

const prefixUnsafeLifecycleMethods = parseFloat(React.version) >= 16.3
const prefixUnsafeLifecycleMethods = typeof React.forwardRef !== 'undefined'

/**
* A <Router> is a high-level API for automatically setting up
Expand Down

0 comments on commit 3865afe

Please sign in to comment.