【发布时间】:2022-01-10 13:31:15
【问题描述】:
const DynPut: FC<Props> = Props => {
const [value, setValue] = useState<string>(['1', '2', '3', '4']);
return (
<View>
{value.map(v => {
<Text>{v}</Text>;
})}
</View>
);
};
无法在屏幕上获取值 1-5。我正在使用打字稿,还保存了带有.tsx扩展名的文件
【问题讨论】:
-
;会在保存文件时自动添加到 map 函数的末尾。无法摆脱它 -
您是否在某处渲染组件,例如 app.tsx?
-
是在 app.tsx 中渲染组件
标签: javascript arrays typescript react-native