You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
299 B
20 lines
299 B
// 函数组件的创建和渲染
|
|
|
|
// 创建
|
|
function Hello() {
|
|
return <div>Hello everbody</div>
|
|
}
|
|
|
|
function App() {
|
|
return (
|
|
<div>
|
|
{/* 渲染Hello组件 */}
|
|
{/* 第一种: */}
|
|
<Hello />
|
|
{/* 第二种 */}
|
|
<Hello></Hello>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default App
|