0

I am using Native base library in React Native. In native base, there is component called Button and also there Component Button from 'react-native'.

If i want to use both Button components simultaneously, what should I do?

krishnazden
  • 1,127
  • 10
  • 19

2 Answers2

4

You can use alias

import { Button } from 'react-native'
import { Button as ButtonBase } from 'native-base';

and

<Button /> {# React Native Button #}
<ButtonBase /> {# Native Base Button #}
Nicolas de C
  • 708
  • 6
  • 13
0

You can simply use use ALIAS by adding word as between the default name and the new name you want example:

import {View as V} form react-native;

and in your render() function you can call it like the

<V>...</V>

so for your question you can do this you can do this

import {Button as ButtonMain} from react-native;
import {Button as ButtonRB} from react-native;

and you can call them in your render() function like this:

<ButtonMain />
<ButtonRB />