NativeBase
NativeBase copied to clipboard
Stack doesn't skip space with custom component return a fragment
Description
Stack doesn't skip space with custom component return a fragment
CodeSandbox/Snack link
https://snack.expo.dev/@giaptran/biased-cookie
Steps to reproduce
const CustomBox = (props: CustomBoxPops) => { const { visible, title, ...rest } = props;
if (!visible) { return <React.Fragment />; }
return <Center {...rest}>{title}</Center>; };
In case a custom component returns a fragment then Stack can not skip space
NativeBase Version
3.4.13
Platform
- [ ] Android
- [ ] CRA
- [X] Expo
- [ ] iOS
- [ ] Next
Other Platform
No response
Additional Information
No response
Hey @TVGSoft, Thanks for reporting the issue. We'll fix it.
Hey, Instead of the fragment you can return null
if you are not returning anything. This is recommended by react.
Hi @ankit-tailor,
Thank you for your recommendation. But even return null, it doesn't fix this issue. I think have to update in react flatten children to skip spacing
Hey @TVGSoft, We'll fix this issue.
Hey ! Any news on this issue ?
Hi! any updates on this issue ?
+1 We are also hoping for this fix to come true 🤞