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

Argument of type { someParam: boolean } is not assignable to parameter of type 'Partial'

$
0
0

I m gotting the error mentioned on the title while I m trying to add some params to the navigator screen using the current generated typenote that it's working on other screens and also on this I can access to it when typing route.params

// Screen is an object of screens nametype RouteType<T extends Object, S extends Screen> = RouteProp<  {    [key in S]: T;  },  S>;export type NavigationInjectedProps<T extends Object, S extends Screen> = {  navigation: NavigationProp<T>;  route: RouteType<T, S>;};

the props added to my component

type Props = NavigationInjectedProps<   params,'ExampleComp'>;

params

interface params {  someParam: boolean;  someOtherParam: string;}

method to set the param where the error is shown

export default ExampleComp ({navigation}:Props) {useEffect(() => {    navigation.setParams({ someParam : false }); // got error here  }, [navigation]);}...

thanks.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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