this is the code
import React from "react";
import ReactDOM from "react-dom/client";
const Header = () => {
return (
<div className="header">
<div className="logo-container">
<img className="logo" src="/assets/logo.jpg" />
</div>
<div className="nav-items">
<ul>
<li>Home</li>
<li>About us</li>
<li>Contact us</li>
<li>Cart</li>
</ul>
</div>
</div>
);
};
const AppLayout = () => {
return (
<div className="App">
<Header />
</div>
);
};
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<AppLayout />);
please help me as i am new to react.
i am expecting an image to be displayed on the server
2
Answers
Try to add an alt tag to your code above, if it still doesn’t work
Try this:
import logo on the top separately and give to src of img tag: