-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
[Stack] weird styling propagated between view #2547
Comments
Hey! This indeed looks strange. We do not interfere with content styling in any way in this lib, so I'm surprised that this happens only with the lib. I'll need to remade the repro as I would not want to have Expo router involved before I start debugging. |
@kkafar let me know if I can help more. It was really painful to identify :/ should I move the sample to a bare react native project ? |
@freeboub If you only have capacity to create a reproducer without expo - that would be of really great help. |
I was able to update the sample app without expo. Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-18.at.22.29.53.mp4Good luck to find the root cause :) |
Update: I have now pushed another commit: 0b7494ade6af232a9ac053cf3a0621f3158299c4. It move every code in 1 file and remove unneeded views. now code looks like this: const App = () => {
const [childDisplayed, setChildDisplayed] = useState(false);
useEffect(() => {
if (childDisplayed) {
setTimeout(() => {
setChildDisplayed(false);
}, 500);
}
}, [childDisplayed]);
return (
<ScreenStack style={StyleSheet.absoluteFill}>
<Screen
key="parent"
activityState={2}
style={StyleSheet.absoluteFill} >
<Pressable
style={styles.pressable}
onPress={() => {
console.log('onPress');
setChildDisplayed(true);
}} />
</Screen>
{childDisplayed ? (
<Screen
key="child"
activityState={2}
style={StyleSheet.absoluteFill}>
<View style={styles.square}/>
<View style={styles.rounded}/>
</Screen>) :
<></> }
</ScreenStack>
);
};
const styles = StyleSheet.create({
pressable: { width: 100, height: 100, backgroundColor: 'red' },
square: {
height: 40,
overflow: 'hidden', // removing hidden fix the issue
backgroundColor: 'green',
},
rounded: {
height: 40,
width: 60,
backgroundColor: 'yellow',
overflow: 'hidden', // removing hidden fix the issue
borderTopRightRadius: 100,
borderTopLeftRadius: 100,
borderBottomEndRadius: 100,
// borderBottomStartRadius: 100, // If we put the 4 radius, the issue is not reproduced
},
}); And here is the video on this version: Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-18.at.23.12.28.mp4 |
Description
It will be hard for me to provide a clear description... In our production app we see some random component border radius applied on unexpected components. I was able to find a reproduction case here is the description of the sample provided (I tried to simplify as much as possible).
1/ Root component:
A ScreenStack with 1 and 2 components alternatively (Parent and Child Component)
Important, all screens in the stack are refreshed when onWillAppear OR onDisappear are called
2/ Parent Component at the bottom of the stack:
3/ Child Component
Additionnal informations:
Steps to reproduce
see description. Here is a video
weird.mp4
Snack or a link to a repository
https://github.com/freeboub/bug-weirdest-mixed-styles
Screens version
4.3.0
React Native version
0.76.3
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Fabric (New Architecture)
Build type
debug & release
Device
simulator & real devices
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: