Wednesday, September 7, 2016

Concatenate in React

To concatenate in React, do as follows:

<a href={"/restaurants?landmarkId=" + this.props.landmark.id}>{this.props.landmark.name}</a>

Reference:
http://stackoverflow.com/questions/21668025/react-jsx-access-props-in-quotes

No comments:

Post a Comment