Before submitting a new issue
Bug summary
When using a custom tab bar with react-native-bottom-tabs, the library measures the tab bar height like this(in TabView):
useLayoutEffect(() => {
if (renderCustomTabBar && customTabBarWrapperRef.current) {
customTabBarWrapperRef.current.measure((_x, _y, _width, height) => {
setTabBarHeight(height);
});
}
}, [renderCustomTabBar]);
// …
{renderCustomTabBar ? (
<View ref={customTabBarWrapperRef}>
{renderCustomTabBar()}
</View>
) : null}
This works for most layouts, but breaks whenever the returned element is absolutely positioned, since absolutely‑positioned children don’t contribute to their parent’s measured size.
Library version
0.0.13
Environment info
Steps to reproduce
-
Set up a bottom‑tabs navigator.
-
Provide a renderCustomTabBar that returns:
<View
style={{
position: 'absolute',
bottom: 0,
width: '100%',
height: 60,
backgroundColor: 'white',
}}
>
{/* … */}
</View>
-
Observe that setTabBarHeight is called with 0 (or an incorrect value).
Reproducible sample code
Before submitting a new issue
Bug summary
When using a custom tab bar with react-native-bottom-tabs, the library measures the tab bar height like this(in
TabView):This works for most layouts, but breaks whenever the returned element is absolutely positioned, since absolutely‑positioned children don’t contribute to their parent’s measured size.
Library version
0.0.13
Environment info
Steps to reproduce
Set up a bottom‑tabs navigator.
Provide a
renderCustomTabBarthat returns:Observe that
setTabBarHeightis called with0(or an incorrect value).Reproducible sample code
none