Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在HTML属性中使用ReactJS组件属性_Reactjs - Fatal编程技术网

在HTML属性中使用ReactJS组件属性

在HTML属性中使用ReactJS组件属性,reactjs,Reactjs,我从React开始,有些事情我想不出来。如何使用属性作为html属性的值 请参阅此代码 var Input = React.createClass({ render: function() { return <input type="text" value="{this.props.value}" />; } }); var Input = React.createClass({ render: function() { return <input

我从React开始,有些事情我想不出来。如何使用属性作为html属性的值

请参阅此代码

var Input = React.createClass({
  render: function() {
    return <input type="text" value="{this.props.value}" />;
  }
});
var Input = React.createClass({
  render: function() {
    return <input type="text" value={this.props.value} />;
  }
});
我想使用要在输入中显示的属性值,但改为显示{this.props.value}


有什么提示吗?

删除引号,他们将其设置为字符串:


删除引号,他们将其设置为字符串: