前端开发_8.React学习总结

一、参考链接:

ReactUI组件库:

React 教程:

路由、状态库:

React 案例参考学习:

  1. https://github.com/909652769/vite-react https://juejin.cn/post/7086024530560286734#heading-4
  2. https://github.com/Magiccwl/dzdp-react https://juejin.cn/post/6844903629619478536#heading-6
  3. https://juejin.cn/post/7108555432997683237
  4. https://juejin.cn/post/7169108697950453773

二、启动

//用cLl启动
npx create-react-app my-app
cd my-app
npm start
//JSX 表达式 props
const heading = <h1>Mozilla Developer Network</h1>;
<App subject="Clarice" />
function App(props) {
  const subject = "React";
  console.log(props);
  return (
    // return statement
  );
}
//state:
this.setState({comment: 'Hello'});
// Correct
this.setState((state, props) => ({
  counter: state.counter + props.increment
}));
//创建一个组件:
mkdir src/components
touch src/components/Todo.js
export default function Todo(props) {
    function HandleValue(e){
        e.preventDefault();
        console.log("zhouyaaaaaaaaaaaa");
    }
    return (
      <button onClick={HandleValue}>Button{props.name}</button>
    );
  }
import Todo from './components/Todo'
<Todo name="Eat" />
<Todo name="Sleep" />
<Todo name="Repeat" />
posted @   cactus9  阅读(13)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示