这是一个非常简单的React Hooks的案例。
分别进入 frontend 和 backend 目录,通过npm install
安装依赖库,npm start
启动,前端默认地址为http://localhost:3000,后端默认地址为http://localhost:5000。
先启动后端,再启动前端。
主要用到了useState
, useEffect
和useContext
。
近期使用React中的hooks的一些心得
这是一个非常简单的React Hooks的案例。
分别进入 frontend 和 backend 目录,通过npm install
安装依赖库,npm start
启动,前端默认地址为http://localhost:3000,后端默认地址为http://localhost:5000。
先启动后端,再启动前端。
主要用到了useState
, useEffect
和useContext
。
近期使用React中的hooks的一些心得