Skip to content

Fix Authentication Flows Static and Dynamic Tab Issues #1419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change Static and Dynamic tabs to better match each other
  • Loading branch information
VimDiesel123 committed Apr 5, 2025
commit ee18a7166ba361beca3b15e30453c353e6640fe9
23 changes: 13 additions & 10 deletions versioned_docs/version-7.x/auth-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ const RootStack = createNativeStackNavigator({
},
},
});
// codeblock-focus-end

const Navigation = createStaticNavigation(RootStack);

export default function App() {
return <Navigation />;
}
// codeblock-focus-end

function HomeScreen() {
return <View />;
Expand Down Expand Up @@ -124,35 +124,38 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

const getIsSignedIn = () => {
// custom logic
const useIsSignedIn = () => {
return true;
};

const useIsSignedOut = () => {
return false;
};

// codeblock-focus-start
export default function App() {
const isSignedIn = getIsSignedIn();
const isSignedIn = useIsSignedIn();

return (
<NavigationContainer>
<Stack.Navigator>
// codeblock-focus-start
{isSignedIn ? (
<>
<Stack.Group>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Profile" component={ProfileScreen} />
<Stack.Screen name="Settings" component={SettingsScreen} />
</>
</Stack.Group>
) : (
<>
<Stack.Group>
<Stack.Screen name="SignIn" component={SignInScreen} />
<Stack.Screen name="SignUp" component={SignUpScreen} />
</>
</Stack.Group>
)}
// codeblock-focus-end
</Stack.Navigator>
</NavigationContainer>
);
}
// codeblock-focus-end

function HomeScreen() {
return <View />;
Expand Down