Javascript 更新由以下管理的视图的属性“占位符”时出错:AndroidTextInput
我试图访问本机基本项组件内部的道具,它抛出Javascript 更新由以下管理的视图的属性“占位符”时出错:AndroidTextInput,javascript,reactjs,react-native,react-redux,jsx,Javascript,Reactjs,React Native,React Redux,Jsx,我试图访问本机基本项组件内部的道具,它抛出 Error while updating property 'placeholder' of a view managed by:AndroidTextInput TypeError: expected dynamic type `string', but had type `int64' 下面是返回此错误的代码 import React, { Component } from 'react'; import { Conta
Error while updating property 'placeholder' of a view managed
by:AndroidTextInput
TypeError: expected dynamic type `string', but had type `int64'
下面是返回此错误的代码
import React, { Component } from 'react';
import { Container, Content, Form, Item, Input, Button, Text } from 'native-base';
export default class EditProduct extends Component {
componentDidMount() {
Actions.refresh({
title: 'Edit Product',
leftTitle: '<',
onLeft: () => {},
});
}
render() {
const id = this.props.id || 'No ID';
const min = this.props.min || 'No Min';
const max = this.props.max || 'No Max';
return (
<Container>
<Content>
<Form>
<Item>
<Input placeholder=id />
</Item>
<Item>
<Input placeholder=max />
</Item>
<Item last>
<Input placeholder=min />
</Item>
<Button block>
<Text>Confirm</Text>
</Button>
</Form>
</Content>
</Container>
);
}
}
如何从int64转换字符串?除了转换之外,还有其他选择吗?输入的props占位符接收字符串,只需将其转换为字符串即可
const id = this.props.id + ""