TypeScript and React
React, JSDoc and JS¶
Return type¶
javascript - When to use JSX.Element vs ReactNode vs ReactElement? - Stack Overflow
JSX.Element
or React.ReactElement
?
React.ReactElement
works for an array of functions??
React.ReactNode
- type for children
Type of a React "callable"¶
interface ComponentProps {
id: number;
}
const renderRoutes = (PassedComponent: React.ComponentType <ComponentProps>) => {
return <PassedComponent
}
Click event¶
Last update:
2023-04-24