sách gpt4 ai đã đi

javascript - 更新 : AndroidTextInput 管理的 View 的属性 'placeholder' 时出错

In lại 作者:行者123 更新时间:2023-12-03 03:52:44 25 4
mua khóa gpt4 Nike

我正在尝试访问 native 基础 Item 组件内部的 prop,它会抛出

    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';

trở lại (

















);
}
}

如何将 int64 转换为字符串?除了转换之外还有其他选择吗?

1 Câu trả lời

输入的 props 占位符接收字符串,只需将其转换为字符串即可。

const id = this.props.id + ""

关于javascript - 更新 : AndroidTextInput 管理的 View 的属性 'placeholder' 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45097595/

25 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com