[docs] Clarify enableScreens documentation


The Expo Screens documentation for using enableScreens from react-native-screens doesn’t highlight the downsides & risks; it only writes:

react-native-screens provides native primitives to represent screens instead of plain components in order to better take advantage of operating system behavior and optimizations around screens

However, there is a significant issue on Android that requires disabling state serialization. This may cause lost state, for example. The consensus is that this is a design limitation of react-native-screens.

I suggest that a doc update would be good to both: 1) add more detail to the current documentation of the value of using react-native-screens (because “in order to better take advantage of operating system behavior and optimizations around screens” is vague), and 2) add a warning about the above known risk and tradeoff on Android (and is this Android-only?).

Link to the related docs page


1 possible answer(s) on “[docs] Clarify enableScreens documentation

  1. @Razorholt – we update the version on each sdk release, once per quarter. you can eject if you need to update sooner.

    @kevgrig – we don’t try to extensively document external libraries like react-native-screens that are included in the sdk. the developer should visit the official documentation for these libraries to become more informed. i think the best way to handle this documentation issue would be to send a PR to react-native-screens to add a “limitations” section, and then we can link to that from the expo docs. cc @WoLewicki

    also, as far as i know the limitation is inherited from react-native itself. the author of screens, former react-native android core maintainer at facebook, explains it here: software-mansion/react-native-screens#17 (comment).