React Demo 02-Beauty Stars

react hooks自2019年1月发布以来已通过去快一年了,苦于没有练手项目吗?在这里我将为你们分享一些简单易懂的hook实战demo,后面的demo复杂度会慢慢增长。react

Beauty Stars

一个简单的评分组件git

难易程度: ⭐github

在线预览npm

源码地址json

相关项目

  • Happy Clicker浏览器

    一个简单的计数器,能够'加一','减一'和'重置'bash

快速开始

  1. 克隆仓库
git clone git@github.com:tangweikun/happy-beauty-stars.git
复制代码
  1. 安装依赖包
cd happy-clicker
yarn | npm install
复制代码
  1. 本地运行
yarn start | npm run start
复制代码
  1. 在浏览器中打开http://localhost:3000查看效果

部署到 Github Pages

  1. 添加 homepagepackage.json
"homepage": "https://myusername.github.io/my-app",
复制代码
  1. 安装 gh-pages
yarn add gh-pages
复制代码
  1. package.json中添加部署脚本
"scripts": {
+   "predeploy": "npm run build",
+   "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
复制代码
  1. 执行 yarn deploy
yarn deploy
复制代码
  1. 打开https://myusername.github.io/my-app查看效果
相关文章
相关标签/搜索