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
[blur] explicitly pass down props on iOS #10648
Conversation
Will take a look at iOS test suite, not exactly sure why this is failing 🤔 |
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.
Shouldn't we also update BlurProps
definition in BlurView.types.ts
so that TS doesn't lead people into believing BlurView
supports props other than tint
, intensity
and style
?
expo/packages/expo-blur/src/BlurView.types.ts
Lines 4 to 7 in 35c6cba
export type BlurProps = { | |
tint: BlurTint; | |
intensity: number; | |
} & React.ComponentProps<typeof View>; |
Plus, we depend on other props being passed to native view in other places (namely children
):
expo/apps/native-component-list/src/screens/QRCodeScreen.tsx
Lines 253 to 259 in 711270f
function Hint({ children }: { children: string }) { | |
return ( | |
<BlurView style={styles.hint} intensity={100} tint="dark"> | |
<Text style={styles.headerText}>{children}</Text> | |
</BlurView> | |
); | |
} |
expo/home/components/ExperienceView.tsx
Lines 39 to 50 in 574a4e8
<StyledBlurView style={{ flex: 1 }}> | |
{experience ? ( | |
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingVertical: 48 }}> | |
<ExperienceContents experience={experience} /> | |
</ScrollView> | |
) : ( | |
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> | |
<ActivityIndicator size="large" /> | |
</View> | |
)} | |
<ModalHeader /> | |
</StyledBlurView> |
expo/docs/pages/versions/unversioned/sdk/blur-view.md
Lines 36 to 39 in 085eca3
{/* Adjust the tint and intensity */} | |
<BlurView intensity={100} style={[StyleSheet.absoluteFill, styles.nonBlurredContent]}> | |
<Text>Hello! I am bluring contents underneath</Text> | |
</BlurView> |
Maybe we should wrap
🤔 |
Why
closes #7290
the component could sometimes be cloned (for example, when wrapped within a
TouchableWithoutFeedback
) and have props passed to it that it does not expectIt looks from the issue that this isn't a problem on Android but to match the expected behavior I think we might want to make the same changes to
BlurView.android.tsx
How
pass down only the props the NativeBlurView expects
Test Plan
yarn test
and tested on the example in the docs https://docs.expo.io/versions/latest/sdk/blur-view/#usage