简体   繁体   中英

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?

None of the package mentioned is built in. You have to install it as per their installation doc. If your project is large please use react-navigation, you'll get good support and large community using it.

You can install react-native-screens and import the navigator from there: https://github.com/kmagiera/react-native-screens#using-native-stack-navigator

Couple of things to note:

  • You need to have react-navigation-stack installed as well
  • The navigator from react-native-screens isn't as customizable, which might be okay depending on your case
  • As far as I have tried, it's a bit buggy right now

React Navigation 5 (alpha) has an official integration for it: https://reactnavigation.org/docs/en/next/native-stack-navigator.html

But all the previous points apply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM