This is my index.js React App
import React from "react";
import ReactDOM from "react-dom";
import { faker } from '@faker-js/faker';
const App = () => {
const avatarx = faker.image.avatar();
return (
<img alt="avatar" src='{avatarx}' />
);
}
ReactDOM.render(<App />, document.querySelector('#root'));
It shows a warning that says 'avatarx' is assigned a value but never used.
If i use the prop {avatarx} outside of the <img> tag, then it shows the url of the image(so its working).
But it doesn't work inside the <img> tag?