web-ridge / react-native-paper-tabs

Smooth and fast cross platform Material Design Tabs for React Native Paper
https://reactnativepapertabs.com
MIT License
199 stars 35 forks source link

Error switching when switching tabs #72

Open shaibusunnuma opened 5 months ago

shaibusunnuma commented 5 months ago

Current behaviour

I get the typescript error below when I switch tabs that have icons: TypeError: this._icon.setNativeProps is not a function (it is undefined)

Expected behaviour

I didn't get this error until I upgraded to expo sdk 50

How to reproduce?

Set any icon in the Tab. Eg. code

<TabsProvider defaultIndex={0}>
      <Tabs disableSwipe>
        <TabScreen label="Bookings" icon="book">
          <Bookings />
        </TabScreen>
        <TabScreen label="Subscriptions" icon="ticket">
          <Subscriptions />
        </TabScreen>
      </Tabs>
    </TabsProvider>

Preview

What have you tried so far?

Tried debugging and the error seems to come from the function createIconSet in @expo/vector-icons

Your Environment

software version
ios x
android 12
react-native 0.73.6
react-native-paper ^5.12.3
node 18.18.2
npm or yarn 1.22.19 (yarn)
expo sdk ^50.0.17
iamMAHAM commented 5 months ago

I confirm this bug in expo@50. the error produced when you add the "icon" option to the TabScreen component.For now, I've commented on the icon option until I find the problem and fix it.

AlejandroRM-DEV commented 4 months ago

+1

Nicobas commented 3 months ago

+1

ashwin9798 commented 2 months ago

+1

sawankumar1012 commented 2 months ago

+1