I\'ve seen multiple examples of React components using Typescript:
class Foo extends React.Component
It seems there is no a
According to this guideline and my exp, I would say :
class Foo extends React.Component {}
when you know you will not recieve props nor stateclass Foo extends React.Component {}
when you know you will recieve props and state but you really don't care what they look likeclass Foo extends React.Component<{}, {}> {}
never saw, seems strangeclass Foo extends React.Component {}
same as null
, it's up to you. I see more often null
than undefined
class Foo extends React.Component {}
bad idea, since seems to be reserved for functions return (when you do not expect one)Other opinions are welcomed