TypeError: React.useRef is not a function.

Please provide the following:

  1. SDK Version: 36
  2. Platforms(Android/iOS/web/all): iOS

I’m getting this error ever since updating to SDK 36:

TypeError: React.useRef is not a function. (In 'React.useRef(false)', 'React.useRef' is undefined)

This error is located at:
    in ExpoRoot (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in DevAppContainer (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

ExpoRoot
    withExpoRoot.js:8:36
renderRoot
    [native code]:0
runRootCallback
    [native code]:0
unstable_runWithPriority
    scheduler.development.js:643:23
renderApplication
    renderApplication.js:52:52
runnables.appKey.run
    AppRegistry.js:116:10
runApplication
    AppRegistry.js:197:26
callFunctionReturnFlushedQueue
    [native code]:0

The React version after updating is 16.9.0 which does includes hooks, so I’m not sure why useRef is not found.

Can someone help?

something is wrong with your code. it’d be helpful for you to share code when you run into a problem. https://snack.expo.io/@notbrent/crabby-churros

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.