Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have this basic App.js file,

import './App.css';

function Header(){
return(
   <Header>
      <h1>hey there</h1>
   </Header>
 );
}


function App() {
return (
    <div className="App">
       <Header />
       <h2>Main</h2>
       <h3>Footer</h3>
    </div>
 );
}

export default App;

The site was loading fine before I created the Header function and put it in app. But now it's stuck on loading, it's not showing anything on the page.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
460 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think you meant to use html header tag like this:


function Header() {
  return (
    <header>
      <h1>hey there</h1>
    </header>
  );
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...