error when I import useContext to another component

I am trying to import the value of useContext but I am getting this error :

  Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

What I am missing here ?

AllThemeContext.js

import React, { createContext, useState } from "react";
export const AllContext = createContext();

const AllContextProvider = (props) => {
  const submittedInput = props.submittedInput;

  return (
    <AllContext.Provider value={{ submittedInput }}>
      {props.children}
    </AllContext.Provider>
  );
};

export default AllContextProvider;

logo.js

import React from "react";
import AllContextProvider from "../context/AllThemeContext";
import "./Logo.scss";
// Component
const Logo = () => {
  return (
    <AllContextProvider.Consumer>
      {(context) => {
        console.log(context);
      }}
    </AllContextProvider.Consumer>
  );
};
export default Logo;

Answer

You should import AllContext from AllThemeContext which is the named export and not the default export.

import React from "react";
import { AllContext } from "../context/AllThemeContext";
import "./Logo.scss";
// Component
const Logo = () => {
  return (
    <AllContext.Consumer>
      {(context) => {
        console.log(context);
      }}
    </AllContext.Consumer>
  );
};
export default Logo;