-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: New architecture support #4574
Changes from 9 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 |
---|---|---|
|
@@ -29,9 +29,11 @@ jobs: | |
- run: | ||
name: Install dependencies | ||
command: | | ||
yarn install --cwd example --frozen-lockfile | ||
yarn install --cwd docs --frozen-lockfile | ||
yarn install --frozen-lockfile | ||
sudo corepack enable | ||
yarn set version berry | ||
yarn --cwd example --frozen-lockfile | ||
yarn --cwd docs --frozen-lockfile | ||
yarn --frozen-lockfile | ||
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.
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. Thanks! Missed that due to backward compatibility. Updated |
||
- save_cache: | ||
key: dependencies-{{ checksum "package.json" }} | ||
paths: | ||
|
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 | ||
BogiKay marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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 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 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 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI shouldn't call
set version
. It should be already set in thepackage.json
. CI should use the same package manager everyone else would use when they runyarn
directly in the project.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, but currently circleCI image is used and they provide it with yarn1 only, so I had to do it that way to force usage of newer version. I'm thinking about updating the CI config and getting away from circleCI image that seem a bit deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BogiKay it will be automatically handled if setup like this https://github.com/callstack/react-native-paper/pull/4574/files#r1886705407
But also enabling corepack should already mean that it would use correct package manager from
package.json
and install it - so there shouldn't need to be an extra step for setting version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra step setting version explicitly removed. Thanks!