Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
React throws Error and Uncaught Error when i use BrowserRouter, how to fix it?

I'm sorry for my inexperience, but I've lost my way. I use Browser Router and it gives me the error " "Error react-doma.production.min.js:216" and ""react-dot.production.min.js:260 Uncaught Error" I do not know how to fix it, because I do not even know the error. My code:

App.js

const BaseTemplate = () => (
    <div className="App">
        <BrowserRouter>
            <Routes>
                <Route path="/" exact component={Mainpage}/>
            </Routes>
        </BrowserRouter>
    </div>
);

function App() {
    return (
        <BaseTemplate/>
    );
}

export default App;
Mainpage.js
const localService = new Service();
class Mainpage extends Component {
    constructor(props) {
        super(props);
        this.state = {
            category: '',
        };
    }
    componentDidMount() {
        document.title = 'Catalogs';
        localService.listCategories().then(r => alert(r.data)).catch(e => alert(e.response));
    }

    render() {
        return (
            <div>
                <p>hi?</p>
                {this.state}
            </div>
        );
    }
}

export default Mainpage;

Before that, I wrote on react about a year ago, and then a similar design worked

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I see you're using React Router v6. Route should be written as such:

<Route path="/" element={<Mainpage/>}/>

This should fix your issue. Else, please provide more code and your complete error.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!