- In the case of TypeScript, if you want to write a function component, would it look like this?
function GuessInput({ onGuess }: { onGuess: (guess: string) => void }) { }
- Why do you have to write
onGuess
twice?
function GuessInput(props: { onGuess: (guess: string) => void }) { }
-
Is this also acceptable?
-
You can find an article on how to write React components that are less likely to receive complaints here.