How does react export a const-generated component separately?

map.js

import React from "react";

const numbers = [1, 2, 3, 4, 5];
const ListItems = numbers.map((number) => <li>{number}</li>)
// console.log(typeof ListItems)
export {
    ListItems
};

map.js imported by App.js

import React, {
  Component
} from "react";

import logo from "./logo.svg";
import "./App.css";
import Test from "./test";
import Clock from "./clock"
import Toggle from "./toggle"
import Page from "./mailbox"
import {ListItems} from "./map"
class App extends Component {
  render() {
    return (
      <div className="App">
        <Test/>
        <Clock/>
        <Toggle/>
        <Page/>
       ***<ListItems/>***
       //
      </div>
    );
  }
}

export default App;

divListItems

Mar.29,2021

map.js uses named exports, while App.js uses default imports. Just unify the two

map.js use default export:

export dafault ListItems

or App.js Import using naming

import { ListItems } from './map'

=
how to use:

      <div className="App">
        <Test/>
        <Clock/>
        <Toggle/>
        <Page/>
       { ListItems }
       //
      </div>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaed07-2207.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaed07-2207.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?