How to fix "attempted import error React"?

  compiler-errors, javascript, reactjs

I just started learning react and I receive this error when I try to export NavigationMenu and import it to Navigation:

Failed to compile
./src/components/Navigation.js
Attempted import error: 'NavigationMenu' is not exported from './NavigationMenu'.
This error occurred during the build time and cannot be dismissed.

This is how I import/export:

NavigationMenu.js:

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

export default NavigationMenu;

Navigation.js:

import React, { useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBars } from "@fortawesome/free-solid-svg-icons";
import { useTransition, animated } from 'react-spring';
import { NavigationMenu} from "./NavigationMenu";

export default Navigation;

Please help, I’m new to programming and no idea what to do!

Source: Ask Javascript Questions

LEAVE A COMMENT