Skip to content

Instantly share code, notes, and snippets.

View XXXMrG's full-sized avatar
🕶️
Rebooting

Keith XXXMrG

🕶️
Rebooting
View GitHub Profile
@XXXMrG
XXXMrG / router.tsx
Created March 31, 2024 12:13
A small react router
import { useCallback, useEffect, useState } from 'react'
import './App.css'
function One() {
return <div>one</div>
}
function Two() {
return <div>two</div>
}
@XXXMrG
XXXMrG / ts-type-guide.md
Created March 25, 2021 11:29 — forked from pissang/ts-type-guide.md
TypeScript 类型编写指南

TypeScript 类型编写指南

前言

本文主要作为平时在 TypeScript 代码中编写类型以及对 TypeScript 代码进行 review 时候的参考手册,并非强制执行的规范,也不涉及纯代码风格以及代码逻辑上的指导。

前置阅读

本文内容参考了下面几个手册,所以强烈建议能够同时阅读完这几个手册。如果大家对 TypeScript 的一些基础用法和特性还不熟悉,也建议先阅读第一个 TypeScript 手册。

___ ____ ____ _ _ ____ _____
\ \//\ \//\ \/// \__/|/ __\/ __/
\ / \ / \ / | |\/||| \/|| | _
/ \ / \ / \ | | ||| /| |_//
/__/\\/__/\\/__/\\\_/ \|\_/\_\\____\
// a useful multi page app config
// you can add folder in src to add pages
const path = require("path")
const fs = require("fs")
const HtmlWebpackPlugin = require("html-webpack-plugin")
const { CleanWebpackPlugin } = require("clean-webpack-plugin")
const webpack = require("webpack")
module.exports = function(env = {}) {
const entry = {}
{
"name": "recursive-animation",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"eject": "react-scripts eject"