You must specify 'to' property

You must specify 'to' property

I am trying to use Link instead of anchor tag. In this Link tag i am using the to property but it gives me error, such as, "You must specify 'to' property".

I am trying to use Link instead of anchor tag. In this Link tag i am using the to property but it gives me error, such as, "You must specify 'to' property".

code of Nav.js file.

import React from "react";
import { Link, NavLink } from "react-router-dom";
const Navbar = () => {
return (
<nav className="nav-wrapper grey darken-3">
  <div className="container">
    <Link className="brand-logo">Sherlock Holmes</Link>
    <ul className="right">
      <li>
        <Link to="/home">Home</Link>
      </li>
        <li>
          <Link to="/about">About</Link>
        </li>
        <li>
          <Link to="/contact">Contact</Link>
        </li>
      </ul>
    </div>
  </nav>
 );
};

export default Navbar;

Code in App.js file.

import React, { Component } from "react";
import NavBar from "./components/Nav";
import { BrowserRouter, Route } from "react-router-dom";
import Home from "./components/Home";
import About from "./components/About";
import Contact from "./components/Contact";

class App2 extends Component { state = {}; render() { return ( <BrowserRouter> <div className="App"> <NavBar /> <Route path="/home" component={Home} /> <Route path="/about" component={About} /> <Route path="/contact" component={Contact} /> </div> </BrowserRouter> ); } }

export default App2;

It gives me an error on App.jsx page at ReactDom.render that you must specify 'to' property.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

React Native Map components for iOS + Android

React Native Map components for iOS + Android.Contribute to react-native-community/react-native-maps development by creating an account on GitHub

How to build a news app with JavaScript and React Native

How to build a news app with JavaScript and React Native

How to Build React Native Wrappers for Native SDKs

React native is an open-source framework for cross-platform mobile development that lets us build mobile apps using Javascript. It works by providing a bridge that facilitates the communication between Javascript and native modules. In this post, we discuss How to Build React Native Wrappers for Native SDKs