我要完全按照React Navigation docs中的说明添加标题按钮。
React.useLayoutEffect(() => {
navigation.setOptions({
headerRight: () => (
<Button onPress={() => setCount(c => c + 1)} title="Update count" />
),
});
}, [navigation]);
得到打字稿错误:
Argument of type '{ headerRight: () => JSX.Element; }' is not assignable to parameter of type 'Partial<BottomTabNavigationOptions>'.
Object literal may only specify known properties, and 'headerRight' does not exist in type 'Partial<BottomTabNavigationOptions>'
任何想法为何以及如何解决?