How to define Props
zenchanhk opened this issue · 2 comments
zenchanhk commented
I'm gonna using resub in react-native, but I have no idea to define the properties of a component. Code as follows:
interface Props {
navigation?;
}
interface State {
value: string;
}
class TodoList extends ComponentBase<Props, State> {
...
}
But Typescript always show a red line under Props
:
[ts] Type 'Props' has no properties in common with type 'Props<any>'.
Any idea to fix this?
berickson1 commented
You'll need to have your interface extend React.Props
zenchanhk commented
@berickson1 It works. Thanks a lot for your help.