react-native-modalize
react-native-modalize copied to clipboard
Blank screen when using react-native-tab-view
If I use react-native-tab-view inside modalize then I dont see my sceneMap data. It shows only blank screen except the header.
Code:
const FirstRoute = () => (
<View style={{ flex: 1, backgroundColor: '#ff4081' }} >
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
<Text>Hello</Text>
</View>
);
const SecondRoute = () => (
<View style={{ flex: 1, backgroundColor: '#673ab7' }} />
);
const ModalReviews = forwardRef<Modalize, IModal

Props>(({}, ref) => {
const layout = useWindowDimensions();
const [index, setIndex] = useState(0);
const renderScene = SceneMap({
first: FirstRoute,
second: SecondRoute,
});
const [routes] = useState([
{
key: 'first', title: 'HI'
},
{
key: 'second', title: 'NEW'
}
])
return (
<Modalize
ref={ref}
handleStyle={{ width: 35, backgroundColor: '#75777a' }}
childrenStyle={{ borderTopLeftRadius: 12, borderTopRightRadius: 12, overflow: 'hidden' }}
>
<TabView
navigationState={{ index, routes }}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{ width: layout.width }}
/>
</Modalize>
)
});
Dependencies:
- react-native-modalize [2.0.13]
- react-native-gesture-handler [2.2.1]
- expo/react-navigation/react-native-navigation: [45.0.0]
any update on that?
Having the same problem here
I'm also having the same issue.
It's still unresolved
For workaround, wrap the component with <View>
with a fixed height:
<Modalize>
<View style={{ height: deviceHeight}}>
<TabView
navigationState={{ index, routes }}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{ width: layout.width }}
/>
</View>
</Modalize>
@anniewey thank u so much!