我要导入两个具有相同名称的模块,即
import {Input, Icon} from 'native-base'
和
import {Input, Button} from 'react-native-elements'
如何在JSX中导入和使用它们两者?有可能吗?
答案 0 :(得分:6)
您可以在导入时使用as
import {Input as InputBase, Icon} from 'native-base'
import {Input, Button} from 'react-native-elements'
答案 1 :(得分:2)
是的,您可以将import用作:
import {Input as NativeBaseInput, Icon } from 'native-base'
import {Input, Button} from 'react-native-elements'