question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i wrap react-navigation into Modalize?

See original GitHub issue

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […]

I want to display a navigator inside the Modalize. Here is my code:

<Portal>
        <Modalize modalHeight={screenHeight * 0.9} withHandle={false} ref={ref}>
          <NavigationContainer independent>
            <Stack.Navigator
              initialRouteName={'SelectProvinceAndDistrict'}
              screenOptions={{
                headerBackTitleVisible: false,
                headerTintColor: Colors.primaryText,
              }}
            >
              <Stack.Screen
                name={'SelectProvinceAndDistrict'}
                component={SelectProvinceAndDistrictScreen}
              />
            </Stack.Navigator>
          </NavigationContainer>
        </Modalize>
      </Portal>

And this is what i got: image

The problems are:

  • No border-radius;
  • A warning “VirtualizedLists should never be nested inside plain ScrollViews with the same orientation”
  • Stack.Screen not rendered

Describe the solution you’d like A clear and concise description of what you want to happen.

I hope the modalize and navigation container works correctly

Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
likeSocommented, Dec 11, 2021

@harveyappleton Okay, thank you

0reactions
harveyappletoncommented, Dec 11, 2021

Also, you can fix the nested virtualized lists error by using custom renderer (docs here)

 <Modalize
     // ...other props here     
     customRenderer={<Animated.View style={{ flex: 1 }}>{/* modal content */}</Animated.View>}
    />

Now I have react navigation working inside the modal, and no errors 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Modalize does not override react navigation
Yes, the reason is, Modalize doesn't use react-native Modal which has separate activity render on top of everything but you can still use ......
Read more >
Opening a modal
Opening a modal. Modal shown on screen. A modal displays content that temporarily blocks interactions with the main view. A modal is like...
Read more >
Better Modals in React Navigation | by Brad Dunn
In order to get a header working on the modal screen we have a few options. We could roll our own header component...
Read more >
Setup a StackNavigator as a Modal in React Navigation
Each one of these screens has a very simple component wrapped inside a safe-area view with buttons to navigate to the detail screen...
Read more >
A guide to React Native Navigation
In React Navigation, all your screens need to be wrapped around the ... Modal presentations generally indicate a start of a new flow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found