react-native - React-navigation 5x 使用 Stack.Screen screenProps
问题描述
我想screenProps
在 React-navigation中传递一些东西v5.x.x
。我是 react-native 的新手之一。谁能帮我?
解决方案
React Navigation 5 中没有screenProps
。您可以使用React 的 Context 功能来将数据向下传递到树中,而无需额外的 API。
https://reactnavigation.org/docs/upgrading-from-4.x#global-props-with-screenprops
推荐阅读
- html - 如何在网站上使用两个背景图片。一个将在另一个前面 - 前面的稍微小一点
- python - 将 JSON 文件发送到 Azure 事件中心
- r - 我怎么知道这个向量中 9 个 TRUE 值的数值。有它的功能吗?
- python - 使用 xarray 和 open_mfdataset 从 url 打开多个文件
- android - 将 OpenGL 片段着色器设置为仅通过漫反射减少 vec4 色点的 RGB 值,而不是 alpha
- asp.net - ASP.Net 1.1 防止配置不工作的 Cookieless 会话 XSS 攻击
- javascript - 无法在 TypeScript 中访问 redux 状态对象的键
- spring-boot - 返回“错误请求”但需要“未找到”
- javascript - Why is amplitude sdk regenerating device Id on every session/tab on the web on desktop?
- java - 实体中的布尔字段更改 JSON 中的名称