我的代码顶部有这些导入:
import React from 'react'
import { StyleSheet, View, Button, Dimensions, TouchableOpacity, Text} from 'react-native'
import { LineChart, Grid } from 'react-native-svg-charts'
import * as shape from 'd3-shape'
import { Circle, G, Line, Rect, Text } from 'react-native-svg'
Run Code Online (Sandbox Code Playgroud)
我想同时使用 react-native 中的 Text 节点和 react-native-svg 中的 Text 节点,可以这样做吗?
我得到的错误是重复声明文本,我可以理解为什么。但我希望在我的代码中同时使用它们,例如:
<G y={ 50 }>
<Rect
height={ 40 }
width={ 75 }
stroke={ 'grey' }
fill={ 'white' }
ry={ 10 }
rx={ 10 }
/>
<Text
x={ 75 / 2 }
dy={ 20 …Run Code Online (Sandbox Code Playgroud) react-native ×1