Closed kopax closed 3 years ago
Will it be better to use React.ReactNode?
TBH, I am just starting with TypeScript. I would personally need to use FunctionComponent<T>
, I don't know how it will behave with ReactNode
without the tslint from my IDE, otherwise I would have fixed it with my other PR.
Hi @jarvisluong I am still having issue to use a function component because of controlProps
, error seems to goes away if I use React.ComponentType<T>
, tough I am not sure it's valid.
Hi @reactrondev,
Reading https://github.com/reactrondev/react-native-web-swiper/blob/637642e30310c0d267d6f0386ae5612717767761/index.d.ts#L162 it seems that we can't use function component with the ComponentClass type.
Is this a voluntary constraints ? Class are becoming obsolete since react 16
It also seems that the typing is incorrect, while
isActive
should be in the props, the current typing force us to useReadonly<SwiperProps>
which does not includeisActive
at all.