passing directly PlayView view function to the react screen to solve loss of state issues
This commit is contained in:
@@ -23,7 +23,7 @@ export const protectedRoutes = <>
|
||||
<Stack.Screen name="Home" component={HomeView} options={{ title: translate('welcome') }} />
|
||||
<Stack.Screen name="Settings" component={SetttingsNavigator} options={{ title: 'Settings' }} />
|
||||
<Stack.Screen name="Song" component={SongLobbyView} options={{ title: translate('play') }} />
|
||||
<Stack.Screen name="Play" component={() => PlayView({ songId: 1 })} options={{ title: translate('play') }} />
|
||||
<Stack.Screen name="Play" component={PlayView} options={{ title: translate('play') }} />
|
||||
<Stack.Screen name="Score" component={ScoreView} options={{ title: translate('score') }} />
|
||||
<Stack.Screen name="Search" component={SearchView} options={{ title: translate('search') }} />
|
||||
<Stack.Screen name="User" component={ProfileView} options={{ title: translate('user') }} />
|
||||
|
||||
@@ -29,7 +29,8 @@ if (process.env.NODE_ENV != 'development' && Platform.OS === 'web') {
|
||||
}
|
||||
}
|
||||
|
||||
const PlayView = ({ songId }: PlayViewProps) => {
|
||||
const PlayView = () => {
|
||||
const songId = 1;
|
||||
const navigation = useNavigation();
|
||||
const queryClient = useQueryClient();
|
||||
const song = useQuery(['song', songId], () => API.getSong(songId));
|
||||
|
||||
Reference in New Issue
Block a user