Getting error: TS2322: Type '(option: Item) => JSX.Element' is not assignable to type 'RenderMenuItemChildren'. #804
Replies: 1 comment
-
This is the answer: #704 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The full error is:
TS2322: Type '(option: Item) => JSX.Element' is not assignable to type 'RenderMenuItemChildren'. Types of parameters 'option' and 'option' are incompatible. Type 'Option' is not assignable to type 'Item'. Type 'string' is not assignable to type 'Item'.
This is when I try to use the example from "https://github.com/ericgio/react-bootstrap-typeahead/blob/v6.2.3/example/src/examples/AsyncExample.tsx" exactly as is.
The line is:
renderMenuItemChildren={(option: Item) => ( <> <img alt={option.login} src={option.avatar_url} style={{ height: '24px', marginRight: '10px', width: '24px', }} /> <span>{option.login}</span> </> )}
Is this a project setting issue? or something else? (Note: I'm a TS newbie)
Beta Was this translation helpful? Give feedback.
All reactions