I am wondering what the correct way is to indicate that the React component does not have props in Typescript.
If I have a component, I can indicate which details and status have two interfaces:
interface MyProps {
text: string
}
interface MyState {
count: number
}
class MyComponent extends React.Component<MyProps, MyState> {
...
}
So, if my component does not have props, should I use void, undefinedor {}?
source
share