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

305
Views
export 'NavBar' (imported as 'NavBar') was not found in './NavBar' (possible exports: default)

Compiled with problems:X

ERROR in ./src/App.js

export 'NavBar' (imported as 'NavBar') was not found in './NavBar' (possible exports: default) That's My NavBar Js I Have Exported Navbar Still I Am Getting This Error :)

import React from 'react';
import { Link } from 'react-router-dom';

const NavBar = () => (
    <nav>
        <ul>
            <li>
                <Link to="/">Home</Link>
            </li>
            <li>
                <Link to="/about">About</Link>
            </li>
            <li>
                <Link to="/articles-list">Articles</Link>
            </li>
        </ul>
    </nav>
);

export default NavBar;

And This Is App.js In Which I Have Exported App But It Is Still Showing Error

import  React , { Component } from 'react';
import { BrowserRouter as Routes, Route, Switch,} from 'react-router-dom';
import { HomePage } from './pages/HomePage';
import { AboutPage } from './pages/AboutPage';
import { ArticlesListPage } from './pages/ArticlesListPage';
import { ArticlePage } from './pages/ArticlePage';
import { NotFoundPage } from './pages/NotFoundPage';
import { NavBar } from './NavBar';
import './App.css';

class App extends Component {
  render() {
    return (
      <Routes>
        <div className="App">
          <NavBar />
            <Switch>
              <Route path="/" component={< HomePage />} exact />
              <Route path="/about" component={< AboutPage /> } />
              <Route path="/articles-list" component={< ArticlesListPage />} />
              <Route path="/article/:name" component={< ArticlePage />} />
              <Route component={< NotFoundPage />} />
            </Switch>
          </div>
      </Routes>
    );
  }
}

export default App;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This may sound silly, but for me when exporting components with export default NavBar for importing i have to put it as

import NavBar from "./NavBar"

instead of

import { NavBar } from "./NavBar

maybe you could try this

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!