From 0199aac757be360ae6a3d9c93bcd403afcf88050 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Tue, 4 Oct 2022 18:52:36 +0000 Subject: [PATCH] doc: Update `react.md` cheatsheet. e7bda84f2ac266dca03543eedcd8a1e0fabe5beb --- docs/react.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/react.html b/docs/react.html index 3e089aea..554e9414 100644 --- a/docs/react.html +++ b/docs/react.html @@ -51,7 +51,10 @@ const root = createRoot(elm); root.render(<App />); -

导入多个导出

+

快速创建 React 项目 (CRA)

+
npx create-react-app my-app
+
+

导入多个导出

import React, {Component} from 'react'
 import ReactDOM from 'react-dom'
 
@@ -860,7 +863,7 @@
:--
any任意类型
(props, propName, 组件名称)=>{}自定义验证器
-

基础

+

基础

@@ -891,7 +894,7 @@
:--
string字符串
number数组
func函数
bool布尔值
symbol-
-

枚举 Enum

+

枚举 Enum

@@ -910,7 +913,7 @@
:--
oneOf(any)枚举类型
oneOfType([type])几种类型中的任意一个类型
-

数组 Array

+

数组 Array

@@ -929,7 +932,7 @@
:--
array数组
arrayOf数组由某一类型的元素组成
-

对象 Object

+

对象 Object

@@ -960,7 +963,7 @@
:--
object对象
objectOf对象由某一类型的值组成
instanceOf(...)类的实例
shape对象由特定的类型值组成
exact有额外属性警告
-

元素 Elements

+

元素 Elements

@@ -983,7 +986,7 @@
:--
elementReact 元素
elementTypeReact 元素类型(即 MyComponent)
nodeDOM 节点
-

必需的

+

必需的