1

This is exactly the code I copied in the video tutorial but I don't know why I got a blank white screen on my browser while the other (original) code doesn't get a blank screen after importing the { Link } from "react-router-dom"; How do you fix this? I can't find any solutions.

Here is my App.js

import React from "react";
import Navbar from "./components/Nav/Navbar";

function App () {
  return (
    
    <div> 
    <Navbar/>
    </div>
    
  );
  
}

export default App;

This is my Navbar.jsx

import React from "react";
import { Link } from "react-router-dom";
import Logo from "../../assets/Logo.png";



const Navbar = () => {
    return (
    <nav className="bg-white">
        <div className="flex items-center font-medium justify-around">
        <div>
            <img src={Logo} alt="logo" className="md:cursor-pointer" />
        </div>
        <ul>
            <li> 
                <Link to="/" className="py-7 px-3 inline-block">
                Home
                </Link>
            </li>
        </ul>
        </div>
    </nav>
    );
};

export default Navbar;
Dprvd
  • 21
  • 2
  • can you share your router config? it seems you are using the Link component out of the Router – Miguel Caro Dec 13 '22 at 16:42
  • Can you let me know what error did you get on that page? – talent-jsdev Dec 13 '22 at 16:56
  • @talent-jsdev there are no errors the code executes successfully but when I load the page it goes blank white however if I remove the import { Link } from "react-router-dom"; and the Home the logo appears. – Dprvd Dec 14 '22 at 10:27

0 Answers0