Reputation: 1177
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?
Upvotes: 0
Views: 602
Reputation: 11
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 />
Upvotes: 0
Reputation: 708
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 #}
Upvotes: 4