Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Failing to connect my ChatRoomScreen to the navigation

$
0
0

Code Below

SyntaxError: /Users/suspect/Desktop/Dev/chatApp/Messenger/navigation/index.tsx: Did not expect a type annotation here. (31:50)

29 | function RootNavigator() {30 | return (

31 | <Stack.Navigator screenOptions={( headerShown : false)} >| ^32 | <Stack.Screen name="ChatRoom" component={ChatRoomScreen} options={{ headerShown: true}} />33 | <Stack.Screen name="Root" component={BottomTabNavigator} />34 | <Stack.Screen name="NotFound" component={NotFoundScreen} options={{ title: 'Oops!' }} />

ABI44_0_0RCTFatal__37-[ABI44_0_0RCTCxxBridge handleError:]_block_invoke_dispatch_call_block_and_release_dispatch_client_callout_dispatch_main_queue_callback_4CFCFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__CFRunLoopRunCFRunLoopRunSpecificGSEventRunModal-[UIApplication _run]UIApplicationMainmainstart_sim0x0

I am working on a messaging app, while creating the RootNavigator Function i keep getting a Type annotation error and failing to compile Ive tried to debug and getting no luck :(

import { createStackNavigator } from '@react-navigation/stack';import * as React from 'react';import { ColorSchemeName } from 'react-native';import NotFoundScreen from '../screens/NotFoundScreen';import { RootStackParamList } from '../types';import LinkingConfiguration from './LinkingConfiguration';import ChatRoomScreen from '../screens/ChatRoomScreen';export default function Navigation({ colorScheme, }: { colorScheme: ColorSchemeName;}) {  return (<NavigationContainer      linking={LinkingConfiguration}      theme={colorScheme === 'dark' ? DarkTheme : DefaultTheme}><RootNavigator /></NavigationContainer>  );}const Stack = createStackNavigator<RootStackParamList>();function RootNavigator() {  return (<Stack.Navigator screenOptions={( headerShown : false)} ><Stack.Screen name="ChatRoom" component={ChatRoomScreen} options={{ headerShown: true}} /><Stack.Screen name="Root" component={BottomTabNavigator} /><Stack.Screen name="NotFound" component={NotFoundScreen} options={{ title: 'Oops!' }} /></Stack.Navigator>  );}```

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>