摘要: 函数组件 // src/components/Hello1.jsx import { useState } from 'react' function Hello1 () { const [ hello1, setHello1 ] = useState('world1') setTimeout(() 阅读全文
posted @ 2025-11-04 15:29 龚思凯1 阅读(2) 评论(0) 推荐(0)
摘要: 函数组件 // src/components/Hello1.jsx import { useState } from 'react' function Hello1 () { const [ hello1, setHello1 ] = useState('world1') return ( <div 阅读全文
posted @ 2025-11-04 15:28 龚思凯1 阅读(2) 评论(0) 推荐(0)
摘要: 函数组件 // src/components/Hello1.jsx import { useState } from 'react' function Hello1 () { const [ hello1, setHello1 ] = useState('world1') return ( <div 阅读全文
posted @ 2025-11-04 15:27 龚思凯1 阅读(3) 评论(0) 推荐(0)
摘要: 函数组件 // src/components/Hello1.jsx function Hello1 () { return ( <div> hello1 </div> ) } export default Hello1; 类组件 // src/components/Hello2.jsx import 阅读全文
posted @ 2025-11-04 15:26 龚思凯1 阅读(2) 评论(0) 推荐(0)
摘要: 创建项目 npx create-react-app react-practice 启动项目 npm start 阅读全文
posted @ 2025-11-04 11:58 龚思凯1 阅读(2) 评论(0) 推荐(0)
摘要: 创建项目 npx create-react-app react-practice 启动项目 npm start 阅读全文
posted @ 2025-11-04 11:55 龚思凯1 阅读(0) 评论(0) 推荐(0)