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

2 years ago
  1. // 函数组件的创建和渲染
  2. // 创建
  3. function Hello() {
  4. return <div>Hello everbody</div>
  5. }
  6. function App() {
  7. return (
  8. <div>
  9. {/* 渲染Hello组件 */}
  10. {/* 第一种: */}
  11. <Hello />
  12. {/* 第二种 */}
  13. <Hello></Hello>
  14. </div>
  15. )
  16. }
  17. export default App