使用React js从api中删除双引号

时间:2017-07-25 23:01:55

标签: node.js api reactjs

我想从API结果中删除de double quote。这是结果: Result

componentDidMount() {
     fetch('/todo/2')
    .then((response) => response.json())
    .then((responseJson) =>{
      this.setState({
        message: responseJson.data.Publicacion
      });
    })
  }

这是我在反应js中打印结果的地方:

<div className="card-container">
     <div className="card">
          <img className="avatar" src={avatar} alt="" />
          <div className="name">Peter Stark</div>
          <div className="date">A las 4:56 p.m. </div>

          <p className="card">
            {JSON.stringify(this.state.message)}
          </p>
     </div>
</div>

0 个答案:

没有答案