'Argument of type { someParam: boolean } is not assignable to parameter of type 'Partial<string | boolean>'
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 type
note 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 name
type 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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
