Is there a right way to pass data into a React component from the HTML page?

前端 未结 4 397
悲&欢浪女
悲&欢浪女 2021-01-31 08:29

I have a React app like this.

var X = React.createClass({
  componentDidMount: function() {
    fetch(this.props.feed).then(...);
  }
  render: function() {
             


        
4条回答
  •  情歌与酒
    2021-01-31 09:04

    You can just pass your data when mounting the component like so:

提交回复
热议问题