Skip to content

The demo code return a type error #614

Answered by jakeboone02
wxhohomsy asked this question in Q&A
Discussion options

You must be logged in to vote

This code only satisfies TypeScript in v7, of which there is an alpha release v7.0.0-alpha.2. (Alpha 3 should be released tomorrow.)

To get around the type issue in v6, you have to be explicit about how you call the state setter method:

// Instead of
onQueryChange={setQuery}

// Use
onQueryChange={q => setQuery(q)}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wxhohomsy
Comment options

Answer selected by wxhohomsy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants