-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: New architecture support #4574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d84923
0af640b
0107899
f81eebc
9b37692
5bbdbbc
4958b86
5d943df
03bcb3b
6fd04d9
035ce56
601fc70
6e606a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,3 +64,6 @@ CHANGELOG.md | |
| lib/ | ||
|
|
||
| .expo | ||
|
|
||
| # Yarn | ||
| .yarn/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nodeLinker: node-modules | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,6 @@ docs/components | |
| # legacy | ||
| dist/ | ||
| .linaria-cache/ | ||
|
|
||
| # Yarn | ||
| .yarn/* | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,12 @@ | ||
| # XDE | ||
| # | ||
| .expo/ | ||
| /coverage | ||
| /coverage | ||
|
|
||
| # Yarn | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import * as React from 'react'; | ||
| import { Platform } from 'react-native'; | ||
| import { Platform, StyleSheet, View } from 'react-native'; | ||
|
|
||
| import type { DrawerNavigationProp } from '@react-navigation/drawer'; | ||
| import { getHeaderTitle } from '@react-navigation/elements'; | ||
|
|
@@ -19,55 +19,68 @@ export default function Root() { | |
| ? CardStyleInterpolators.forFadeFromBottomAndroid | ||
| : CardStyleInterpolators.forHorizontalIOS; | ||
| return ( | ||
| <Stack.Navigator | ||
| screenOptions={({ navigation }) => { | ||
| return { | ||
| detachPreviousScreen: !navigation.isFocused(), | ||
| cardStyleInterpolator, | ||
| header: ({ navigation, route, options, back }) => { | ||
| const title = getHeaderTitle(options, route.name); | ||
| return ( | ||
| <Appbar.Header elevated> | ||
| {back ? ( | ||
| <Appbar.BackAction onPress={() => navigation.goBack()} /> | ||
| ) : (navigation as any).openDrawer ? ( | ||
| <Appbar.Action | ||
| icon="menu" | ||
| isLeading | ||
| onPress={() => | ||
| ( | ||
| navigation as any as DrawerNavigationProp<{}> | ||
| ).openDrawer() | ||
| } | ||
| /> | ||
| ) : null} | ||
| <Appbar.Content title={title} /> | ||
| </Appbar.Header> | ||
| ); | ||
| }, | ||
| }; | ||
| }} | ||
| > | ||
| <Stack.Screen | ||
| name="ExampleList" | ||
| component={ExampleList} | ||
| options={{ | ||
| title: 'Examples', | ||
| <View style={styles.stackWrapper}> | ||
| <Stack.Navigator | ||
| screenOptions={({ navigation }) => { | ||
| return { | ||
| detachPreviousScreen: !navigation.isFocused(), | ||
| cardStyleInterpolator, | ||
| header: ({ navigation, route, options, back }) => { | ||
| const title = getHeaderTitle(options, route.name); | ||
| return ( | ||
| <Appbar.Header elevated> | ||
| {back ? ( | ||
| <Appbar.BackAction onPress={() => navigation.goBack()} /> | ||
| ) : (navigation as any).openDrawer ? ( | ||
| <Appbar.Action | ||
| icon="menu" | ||
| isLeading | ||
| onPress={() => | ||
| ( | ||
| navigation as any as DrawerNavigationProp<{}> | ||
| ).openDrawer() | ||
| } | ||
| /> | ||
| ) : null} | ||
| <Appbar.Content title={title} /> | ||
| </Appbar.Header> | ||
| ); | ||
| }, | ||
| }; | ||
| }} | ||
| /> | ||
| {(Object.keys(examples) as Array<keyof typeof examples>).map((id) => { | ||
| return ( | ||
| <Stack.Screen | ||
| key={id} | ||
| name={id} | ||
| component={examples[id]} | ||
| options={{ | ||
| title: examples[id].title, | ||
| headerShown: id !== 'themingWithReactNavigation', | ||
| }} | ||
| /> | ||
| ); | ||
| })} | ||
| </Stack.Navigator> | ||
| > | ||
| <Stack.Screen | ||
| name="ExampleList" | ||
| component={ExampleList} | ||
| options={{ | ||
| title: 'Examples', | ||
| }} | ||
| /> | ||
| {(Object.keys(examples) as Array<keyof typeof examples>).map((id) => { | ||
| return ( | ||
| <Stack.Screen | ||
| key={id} | ||
| name={id} | ||
| component={examples[id]} | ||
| options={{ | ||
| title: examples[id].title, | ||
| headerShown: id !== 'themingWithReactNavigation', | ||
| }} | ||
| /> | ||
| ); | ||
| })} | ||
| </Stack.Navigator> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| stackWrapper: { | ||
| flex: 1, | ||
| ...Platform.select({ | ||
| web: { | ||
| overflow: 'scroll', | ||
| }, | ||
| }), | ||
| }, | ||
| }); | ||
|
Comment on lines
+77
to
+86
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is React Navigation not working on Web? This shouldn't be needed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scrolling doesn't work without these changes. If I remember correctly it's caused by
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could've something to do with the styles in here that differ from default expo setup https://github.com/callstack/react-native-paper/blob/main/example/public/index.html
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried the default ones from expo and it didn't help. I investigated that in the past and the breaking change is somewhere within components provided by navigation stack |
||
Uh oh!
There was an error while loading. Please reload this page.