Issue
[I keep getting the error that says 'string' is not assignable to parameter of type 'never' in react native typescript and I don't know why. Can someone help me fix this bug.
Thank you in advance.
code snippet :
const loadReport = (id: string) => {
setPostId(id);
navigation.navigate('Report', {postId: id});
}
I get an underline under 'Report'.
Solution
The only solution I found is to apply the type never on the string name.
const goToContent = () => {
navigate("Content" as never, {} as never);
};
I'm not sure it's the best solution but it's work.
Answered By - Frédéric Fara Wat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.