首页 > 解决方案 > React-navigation 5x 使用 Stack.Screen screenProps

问题描述

我想screenProps在 React-navigation中传递一些东西v5.x.x。我是 react-native 的新手之一。谁能帮我?

标签: react-nativereact-navigation-v5

解决方案


React Navigation 5 中没有screenProps。您可以使用React 的 Context 功能来将数据向下传递到树中,而无需额外的 API。

https://reactnavigation.org/docs/upgrading-from-4.x#global-props-with-screenprops


推荐阅读