I've seen two ways of declaring a SFC in React with Typescript, which are these two:
import * as React from 'react'
interface Props {
message: string
}
const Component = (props: Props) => {
const { message } = props
return (
<div>{message}</div>
)
}
export default Component
and:
import * as React from 'react'
interface Props {
message: string
}
const Component: React.StatelessComponent<Props> = props => {
const { message } = props
return (
<div>{message}</div>
)
}
export default Component
From this question I see that with the second way you can omit children from your interface if you are using it in your component.
Are there any more differences? Which one is the preferred one and why?