首页 > 解决方案 > How to use react-native-screens with react-navigation v4?

问题描述

I have read a title which react-native-screens package make faster the react-native navigation while using react-navigation.

And I dont find a good help of usage.

Now I want to know

  1. Do I need to install this package separately?
  2. Is it built into react-navigation in before?
  3. If it is built in before, So Do I need to use it or it is used already?

标签: javascriptreact-nativereact-navigation

解决方案


您可以从那里安装react-native-screens和导入导航器:https ://github.com/kmagiera/react-native-screens#using-native-stack-navigator

需要注意的几点:

  • 你也需要react-navigation-stack安装
  • 来自的导航react-native-screens器不是可定制的,这可能取决于您的情况
  • 据我尝试,现在有点问题

React Navigation 5 (alpha) 有一个官方集成:https ://reactnavigation.org/docs/en/next/native-stack-navigator.html

但是前面的所有要点都适用。


推荐阅读