PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
829 stars 160 forks source link

Update TabReactElement - allow null as Tab #249

Closed hirbod closed 2 years ago

hirbod commented 2 years ago

Without this, TypeScript linter won't allow conditional tabs with a null return.

martymfly commented 2 years ago

Without this, TypeScript linter won't allow conditional tabs with a null return.

This didn't work for me. I still get this ts error. Any other workaround?

Type 'Element | null' is not assignable to type 'TabReactElement'. Type 'null' is not assignable to type 'ReactElement<TabProps, string | JSXElementConstructor>'

andreialecu commented 2 years ago

I pulled in this change into the latest RC in https://github.com/PedroBern/react-native-collapsible-tab-view/pull/255.

Also fixed the other TypeScript error.

It's already on npm as 5.0.0-rc.9 if you'd like to try it