Skip to content

Instantly share code, notes, and snippets.

@Eliah7
Last active April 30, 2021 07:13
Show Gist options
  • Select an option

  • Save Eliah7/6fa9e82ee74e2d6c7295748dfc9e87e0 to your computer and use it in GitHub Desktop.

Select an option

Save Eliah7/6fa9e82ee74e2d6c7295748dfc9e87e0 to your computer and use it in GitHub Desktop.
const RoleBasedAccessApp: () => React$Node = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
options={{title: 'Login', headerShown: false}}
name={'/accounts/login'}
component={LoginPage}
/>
<Stack.Screen
option={{title: 'Dashboard', headerShown: true}}
name={'/dashboard'}>
{(_) => (
<RoleBasedView guards={[ActiveShopGuard]} component={LoginPage} />
)}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
};
export default RoleBasedAccessApp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment