Nativebase: Tabs fail: JSON value '(1,1,1, ...)' of type NSMutableArray cannot be converted to BOOL

Created on 11 Sep 2020  路  4Comments  路  Source: GeekyAnts/NativeBase

Hi everyone.
I'm trying to use Animated.View in Tabs renderTabBar param and getting this error

Simulator Screen Shot - iPhone 11 - 2020-09-11 at 12 40 34

and this is my code

Screen Shot 2020-09-11 at 12 40 56

"react-native": "0.63.2"
"native-base": "^2.13.8"

Everything is working on "react-native": "0.61.5"

awaiting response

Most helpful comment

@iqorlobanov

I was facing the same issue with Animated.View

I wrapped it in <> </> and it fixed the issue for me.

Screenshot 2020-09-28 at 5 39 26 PM

All 4 comments

Hi @iqorlobanov , can you provide minimal code reproduction on snack for the same?

I also experience this.

This is rendered perfectly okay

<Tabs
  renderTabBar={props => (props && <ScrollableTab />)}
>
  <Tab heading="Tab 1">
    <View>
      <Text>Tab 1</Text>
    </View>
  </Tab>
  <Tab heading="Tab 2">
    <View>
      <Text>Tab 2</Text>
    </View>
  </Tab>
</Tabs>

I found out that if you're using a root view inside renderTabBar, you'll get some error.
Also, by passing {...props} to ScrollableTab is causing the error if you're using <Animated.View>.
example:

<Tabs
  renderTabBar={props => (props && 
      <Animated.View>
        <ScrollableTab { ...props } />
      </Animated.View>
    )
  }
>
  <Tab heading="Tab 1">
    <View>
      <Text>Tab 1</Text>
    </View>
  </Tab>
  <Tab heading="Tab 2">
    <View>
      <Text>Tab 2</Text>
    </View>
  </Tab>
</Tabs>

@iqorlobanov

I was facing the same issue with Animated.View

I wrapped it in <> </> and it fixed the issue for me.

Screenshot 2020-09-28 at 5 39 26 PM

@iqorlobanov

I was facing the same issue with Animated.View

I wrapped it in <> </> and it fixed the issue for me.

Screenshot 2020-09-28 at 5 39 26 PM

Thanks! It works :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agersoncgps picture agersoncgps  路  3Comments

natashache picture natashache  路  3Comments

elnygren picture elnygren  路  3Comments

bsiddiqui picture bsiddiqui  路  3Comments

maphongba008 picture maphongba008  路  3Comments