} options={{ tabBarLabel: 'Sheet', tabBarIcon: ({ color, size }) => (" /> } options={{ tabBarLabel: 'Sheet', tabBarIcon: ({ color, size }) => (" /> } options={{ tabBarLabel: 'Sheet', tabBarIcon: ({ color, size }) => ("/>

Why is my tab screen rerendering if there is no change in fiveElements?

32 views Asked by At
<Tab.Screen 
        name="Sheet" 
        children={()=><SheetScreen fiveElements={fiveElements}/>}
        options={{
          tabBarLabel: 'Sheet',
          tabBarIcon: ({ color, size }) => (
            <MaterialCommunityIcons name="information-outline" color={color} size={size} />
          ),
        }}
/> 

Why is my tab screen rerendering if there is no change in the fiveElements state?

1

There are 1 answers

0
Shariq Shahid On

Would be best if you use the Screen this way:

<Tab.Screen 
        name="Sheet" 
        options={{
          tabBarLabel: 'Sheet',
          tabBarIcon: ({ color, size }) => (
            <MaterialCommunityIcons name="information-outline" color={color} size={size} />
          ),
        }}
> 
props => <SheetScreen {...props} fiveElements={fiveElements}/>
</Tab.Screen>