import image from './path-to-image';
<img src={image} height={100} width={100} />
<img src={require('./logo.jpeg')} />
import logo from './logo.jpeg'; // with import
const logo = require('./logo.jpeg); // with require
<img src={logo} />
// METHOD 1
import logo from './logo.jpeg';
<img src={logo} />
// Method 2
const logo = require('./logo.jpeg');
<img src={logo.default} />
// Method 3
<img src={require('./logo.jpeg').default} />
import { PhotoProvider, PhotoView } from 'react-photo-view';
import 'react-photo-view/dist/react-photo-view.css';
export default function App() {
return (
<PhotoProvider>
<PhotoView src="/1.jpg">
<img src="/1-thumbnail.jpg" alt="" />
</PhotoView>
</PhotoProvider>
);
}