Skip to content

kingzez/react-template

Repository files navigation

English | 简体中文

React Template

Use Package

  • react
  • react-router v5
  • redux
  • react-redux
  • connected-react-router
  • antd
  • prop-types

TODO

  • antd ui
  • custom theme
  • react-router
  • react-redux
  • admin layout
  • sidebar support nest
  • create-rtpl (create-rtpl template installer)
  • typescript version priority
  • pipeline
  • redux-saga (side effect model)
  • fetch package (use axios)
  • permission
  • multi api
  • sso
  • graphql
  • redux-logger

Usage

install dependency

npm i

dev

npm start

build

npm run build

analyze build

npm run analyze

serve static, need build first

npm run serve

Naming Learn more

Button.module.css

.error {
  background-color: red;
}

another-stylesheet.css

.error {
  color: red;
}

Button.js

import React, { Component } from 'react';
import styles from './Button.module.css'; // Import css modules stylesheet as styles
import './another-stylesheet.css'; // Import regular stylesheet
class Button extends Component {
  render() {
    // reference as a js object
    return <button className={styles.error}>Error Button</button>;
  }
}

typescript-plugin-css-modules vscode can intelligence