Answer the question
In order to leave comments, you need to log in
How to correctly pass props to a React component using TypeScript?
Greetings!
What is the difference between these notations? And which option is better and why?
export const AuthDialog = ({onClose, isVisible}: AuthDialogInterface): JSX.Element => //.....
export const AuthDialog: FC<AuthDialogInterface> = ({onClose, isVisible}): JSX.Element => //.....
Answer the question
In order to leave comments, you need to log in
In the second case, you can pass children, and you do not need to add ": JSX.Element"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question