-1

the code is as follows i am getting error

" React' must be in scope when using JSX react/react-in-jsx-scope" ***

import {BrowserRouter as  Router, Routes, Route} from 'react-router-dom';
    
    function App() {
      return (
        <>
        <Router>
        <Navbar/>
        <Routes>
          <Route path= '/' exact />
          </Routes>
        </Router>
         
        </>
      );
    }
    
    export default App;

1

2 Answers 2

2

Since you haven't provided the full code here, I assume that your React import statement is wrong. Import React on top of your .js file

import React from 'react';
Sign up to request clarification or add additional context in comments.

Comments

1

Error came because you did not import React.

import react from 'react';

This import is required under React 17 And no more required since React 17

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.