Tanishq SIngh Anand
Tanishq SIngh Anand

Reputation: 61

React router redirects automatically

I am working on a react app When I run yarn start It runs the app and redirects to http://localhost:300/ngo and I havent given any redirect or such route in the whole code

This is my App.js router

   <Router>
     <div className="app">
       <Switch>
         <Route path="/" exact>
           <Home />
         </Route>
         <Route path="/login" exact>
           <Login />
         </Route>
         <Route path="/admin" exact>
           <Admin />
         </Route>
         <Route path="/profile" exact>
           <MyProfile />
         </Route>
       </Switch>
     </div>
   </Router>
 );

Redirected URL

Not used the route

What all are the possible errors or Fix ?

Upvotes: 1

Views: 58

Answers (1)

Tanishq SIngh Anand
Tanishq SIngh Anand

Reputation: 61

So I got the error It was that in the package.json the homepage was given as https://<url>/ngo because of which this was happening

Upvotes: 1

Related Questions