Expo 39 and React navigation Error

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

Just upgraded to SDK 39 and run into following error:

currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput
- node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
- node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
- node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
- node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
- node_modules/react-native/Libraries/Components/TextInput/TextInputState.js:40:6 in currentlyFocusedField
* http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:144357:70 in <unknown>
* http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:141802:60 in <unknown>
- node_modules/react-native-gesture-handler/createHandler.js:162:61 in Handler#_onGestureHandlerStateChange
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:265:4 in invokeGuardedCallbackImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:476:2 in invokeGuardedCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:500:2 in invokeGuardedCallbackAndCatchFirstError
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:597:41 in executeDispatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:621:19 in executeDispatchesInOrder
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2521:28 in executeDispatchesAndRelease
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:838:4 in forEachAccumulated
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2546:20 in runEventsInBatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2702:18 in runExtractedPluginEventsInBatch
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2639:35 in batchedUpdates$argument_0
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17712:13 in batchedUpdates$1
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2492:29 in batchedUpdates
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2638:16 in _receiveRootNodeIDEvent
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:2713:25 in receiveEvent
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:416:4 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:109:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

Using this Navigation container:

 <NavigationContainer>
                <Stack.Navigator
                    initialRouteName="Home"
                    screenOptions={{
                        gestureEnabled: true,
                        cardOverlayEnabled: true,
                        ...TransitionPresets.ModalPresentationIOS,
                    }}
                    headerMode="none"
                    mode="modal"
                >
                    <Stack.Screen
                        name="Home"
                        component={HomeScreen}
                    />
                    <Stack.Screen
                        name="Item"
                        component={ItemScreen}
                    />
                </Stack.Navigator>
 </NavigationContainer >

The error always gets thrown, when I try to close the second screen by moving it down from the top.
Already ran “expo install” and my current fix is to comment the error log out… Not happy about it, so I would appreciate your help :confused:

this was fixed in @react-navigation/stack@5.6.0 - react-navigation/CHANGELOG.md at b029e0f6606e9e37e2c67131439aa11da5bf5b8e · react-navigation/react-navigation · GitHub

1 Like

Hi,
Still get the following error even with sentry-expo 3.0.2 installed in package-lock.json
currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput

  • node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
  • node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
  • node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
  • node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
  • node_modules/@sentry/utils/dist/instrument.js:110:42 in
  • node_modules/react-native/Libraries/Components/TextInput/TextInputState.js:39:4 in currentlyFocusedField
  • node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:189:10 in emit
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:416:4 in __callFunction
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:109:6 in __guard$argument_0
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
  • [native code]:null in callFunctionReturnFlushedQueue

Any hint?
Thanks
Morgan

search your node_modules for currentlyFocusedField to track down where it comes from

ok that was fixed re-installing react-native-keyboard-aware-scroll-view.
(currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput · Issue #440 · APSL/react-native-keyboard-aware-scroll-view · GitHub)

const currentlyFocusedField = TextInput.State.currentlyFocusedInput ? findNodeHandle(TextInput.State.currentlyFocusedInput()) : TextInput.State.currentlyFocusedField()

1 Like

Thank you!
I have just updated my app to SDK 39, but after that, the following error has been dropped, and neither Android Simulator nor Xcode didn’t want to open the app:

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.

So, I re-installed “react-native-keyboard-aware-scroll-view” which I had as well as you.
And this helped. :clap:t2:

1 Like

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