Skip to content

How to migrate from drawerLockMode to swipeEnabled for drawer navigator #9931

Answered by iamshadmirza
iamshadmirza asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out, adding the answer for future reference

import { getFocusedRouteNameFromRoute } from '@react-navigation/core';
.
.
..
screenOptions={({ route }) => {
     const routeName = getFocusedRouteNameFromRoute(route) ?? 'Feed';
     return {
        swipeEnabled: routeName === 'Feed',
     };
}}

Replies: 1 comment

Comment options

iamshadmirza
Sep 14, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by iamshadmirza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant