I have an object(user.js), App.js and an image(admin.png) in the same directory.
user.js
export const user = {
name: 'ADMIN',
logo: './a.png'
}
Inside App component, I am trying to access the image, but it’s not working.
App.js
import { user } from './user.js'
function App() {
return (
<div>
<h1>{user.name}</h1>
<img src={user.logo} height={20} width={20} />
</div>
);
}