Very strange bug with Expo SDK 22

#1

I just upgraded my app to use SDK22 and ran into a really strange error. After the update, my app wouldn’t start (in the iOS simulator). All I got was a white screen and the Exponent app would peg the CPU. If I debugged with the chrome debugger, the app would start and function correctly. However, you could tell there was some background thread pegging the CPU.

After a day of eliminating all the causes I traced it down to 1 line of code I had that looked something like

  render() {
    return <RootStackNavigator ref={(r) => console.log("got ref", r)}/>;
  }

I am using react-navigation and had some logging left from before. If I take out the console.log everything works fine! It looks like some kind of race condition to me. You can reproduce it by taking the default tab navigation expo project and adding the ref property to the RootStackNavigator just as above.

1 Like
#2

hey @pstockley, thanks for posting this. If you’ve got a reproducible issue, thats awesome and i’d highly encourage you to post it in https://github.com/expo/expo/issues or https://github.com/react-community/react-navigation/issues for the issue to get logged and routed.

#3

Created an issue https://github.com/expo/expo/issues/863