React Js
Images in React js
There is 2types of process to insert images into react app,
Step One ::
Here in first step by using JSX Format you can insert, images with the help of template literals in react js , for that you have to place your image inside the src folder then follow this process
import React from 'react';
import './App.css';
import image from './image.jpg';
function App() {
return (
<div>
<img src={image} />
</div>
);
}
export default App;
Step Two ::
you have to place your image inside the public folder then you can write html img src element to insert image in react app
import React from 'react';
import './App.css';
function App() {
return (
<div>
<img src="image.jpg" width={200} />
</div>
);
}
export default App;