How to reference images in react: First open the code editor; then use the require method to introduce it, the code is [].
How to reference images in react:
The usual method is
<img src="路径"></img>
but in This will report an error in React
The correct method should be
Use the require method
<img src={require( “路径”)}></img>
Related learning recommendations: javascript learning tutorial
The above is the detailed content of How to quote images in react. For more information, please follow other related articles on the PHP Chinese website!