juzello
juzello

Reputation: 401

Img tag doesn't show image in React JSX

I'm trying to add a logo to a Header component in react, but it's not showing. It's like it is transparent because if I justify items with flex and space between, it counts like an element. I don't know what I'm doing wrong.

import React from "react";
import "./Header.css";

const Header = () => {
  return (
    <div className="header">
      <img src="../img/logo.png" alt="" />
      <h1>ONE</h1>
      <h1>TWO</h1>
    </div>
  );
};

export default Header;

Upvotes: 0

Views: 424

Answers (1)

emre-ozgun
emre-ozgun

Reputation: 762

import logo from '<PATH>';

return <img src={logo} alt="Logo" />;

Upvotes: 1

Related Questions