react-native-modalize icon indicating copy to clipboard operation
react-native-modalize copied to clipboard

Blank screen when using react-native-tab-view

Open shop-fluencer opened this issue 2 years ago • 6 comments

WhatsApp Image 2022-06-07 at 16 50 38 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
![WhatsApp Image 2022-06-07 at 16 50 38](https://user-images.githubusercontent.com/101994056/172412739-e3911a36-82d9-4205-995c-e27c47c928ac.jpeg)
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]

shop-fluencer avatar Jun 07 '22 14:06 shop-fluencer

any update on that?

obiwankenoobi avatar Jul 03 '22 17:07 obiwankenoobi

Having the same problem here

gmartpad avatar Jul 07 '22 14:07 gmartpad

I'm also having the same issue.

shahedzaman-web avatar Jul 08 '22 04:07 shahedzaman-web

It's still unresolved

bonnmh avatar Sep 09 '22 08:09 bonnmh

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 avatar Dec 27 '22 17:12 anniewey

@anniewey thank u so much!

kaan3392 avatar Aug 14 '23 18:08 kaan3392