<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>ESP8266 Control</title> <script src="https://npmcdn.com/react@15.3.0/dist/react.js"></script> <script src="https://npmcdn.com/react-dom@15.3.0/dist/react-dom.js"></script> <script src="https://npmcdn.com/babel-core@5.8.38/browser.js"></script> <script src="https://npmcdn.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://npmcdn.com/remarkable@1.6.2/dist/remarkable.min.js"></script> </head> <body> <div id="content"></div> <script type="text/babel"> var Slider = React.createClass ({ componentDidMount: function() { }, render: function(props) { } }); ReactDOM.render( <Slider />, document.getElementById('content') ); </body> </html>
Bad:
<img className="image" src="images/{this.props.image}" />
Ok:
<img className="image" src={"images/" + this.props.image} />
<img className="image" src={`images/${this.props.image}`} />