| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: supersede Platform.isTVOS for Platform.isTV (#10973) **Motivation** This PR supersedes a deprecated Platform.isTVOS which got removed in https://github.com/facebook/react-native/pull/34071 for the currently used standard - a Platform.isTV check. Platform.isTV check exists since react-native v0.61 that way no breaking changes are introduced to react-navigation. Ref: https://github.com/software-mansion/react-native-screens/pull/1605 | 3 年前 | |
chore: sort imports automatically | 3 年前 | |
feat: add an ID prop to navigators When we have nested navigators, we often may want control over which navigator should handle an action that we dispatch. This is often handled automatically, e.g. if you navigate to a screen named Settings, the navigator which contains the Settings screen will handle the action. But in some cases, it's not possible to figure out the navigator automatically. Some example cases: We may want to have nested drawers to have a drawer on the left, and one on the right - and still be able to open/close them. We can use getParent to achieve this: js navigation.getParent().openDrawer(); However, this is prone to error if we nest another navigator inside (e.g. a stack). So we need a way to distinguish between which drawer we want to target. An alternative way to distinguish different navigators is to specify the key of the navigator in the target field of the action: js navigation.dispatch({ ...DrawerActions.openDrawer(), target: 'keyOfTheDrawer', }); However, this has a few problems: - It's not straightforward to get the key of the navigator since the key is generated by React Navigation. - It's not type-safe. Nothing ensures that the key is valid. We may also want to call setOptions on a parent navigator. The options don't bubble up unlike the actions, so it's important make sure to call it for the correct navigator. We can use getParent in this case as well, but it's prone to the same set of issues as the previous case. There are also no alternatives for this unlike specifying key for actions. This commit adds a id prop to navigators. Example: js <Drawer.Navigator id="LeftDrawer">{/* ... */}</Drawer.Navigator> Then we can use it along with getParent as follows: js navigation.getParent('LeftDrawer').openDrawer(); No matter how many nested navigators are added, we can always find the correct navigator this way. To make this work with type-checking, we'd pass a third generic to our NavigationProp or ScreenProps types: ts type LeftDrawerScreenProps<T extends keyof LeftDrawerParamList> = DrawerScreenProps<LeftDrawerParamList, T, 'LeftDrawer'>; This isn't the best way to do this, for example, the id prop on the navigator itself isn't type-safe. But supporting it with a good API is a lot of work, so for now, I've decided to go with this alternative approach. | 3 年前 | |
chore: upgrade dependencies on 6.x (#11421) Followed https://github.com/react-navigation/react-navigation/pull/11090 and https://github.com/react-navigation/react-navigation/pull/11380 ## Test - yarn lint - yarn build - yarn test - yarn example test:e2e Run example app | 3 年前 | |
feat:添加鸿蒙侧emit事件处理 Signed-off-by: liujiahui <liujiahui55@chinasoftinc.com> | 7 个月前 | |
feat: [#14]新增stack库 (cherry picked from commit 2bfcc098862fc524ca5d6c560f9fb45975e074a8) Signed-off-by: ludeyin <2930650146@qq.com> | 9 个月前 | |
feat(native-stack): export NativeStackView to support custom routers on native-stack (#10260) Currently, there is no way to create a custom navigator and router on top of **Native-Stack** So by exporting **NativeStackView** along with its types from native-stack, we can use it along with **useNavigationBuilder** to create custom navigators with some additional functionality built on top of it. We can also use **StackRouter** from **@react-navigation/native** to create customised routers and use it with the navigator we created on top of **NativeStackView**. We can follow the same doc to extend NativeStackView with our own router or build additional functionality on top of it. https://reactnavigation.org/docs/custom-navigators#extending-navigators. Co-authored-by: Aditya Pahilwani <aditya.pahilwani@groww.in> | 3 年前 | |
chore: upgrade dependencies on 6.x (#11421) Followed https://github.com/react-navigation/react-navigation/pull/11090 and https://github.com/react-navigation/react-navigation/pull/11380 ## Test - yarn lint - yarn build - yarn test - yarn example test:e2e Run example app | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 7 个月前 | ||
| 9 个月前 | ||
| 3 年前 | ||
| 3 年前 |