
REACT
梓沂
这个作者很懒,什么都没留下…
展开
-
js的script标签到底是放在head还是body中?
https://www.jianshu.com/p/2e6f9b732a91转载 2021-04-13 10:13:59 · 1672 阅读 · 0 评论 -
react中使用echarts的bmap
要使用echarts的bmap,需要引入bmap和百度地图api的ak。1、引入bmap:(不引入虽然不会报错,但地图不会显示)import React, {useRef, useEffect} from 'react';//import echarts from 'echarts/lib/echarts'; import * as echarts from 'echarts';import 'echarts/extension/bmap/bmap'; //引入bmap//let ex原创 2021-04-10 21:18:38 · 1401 阅读 · 3 评论 -
react-hooks/exhaustive-deps警告
import React, {useRef, useEffect} from 'react';import {useTheme} from '@material-ui/core/styles';//import echarts from 'echarts/lib/echarts'; import * as echarts from 'echarts';//let exfn = ()=><div>页面</div>;export default function .原创 2021-04-03 12:35:17 · 7723 阅读 · 0 评论 -
react和material-ui基础概念
import React, {useRef, useEffect} from 'react';import {useTheme} from '@material-ui/core/styles';//import echarts from 'echarts/lib/echarts'; import * as echarts from 'echarts';//let exfn = ()=><div>页面</div>;export default function(.原创 2021-03-23 23:24:50 · 2727 阅读 · 0 评论 -
ES6中的Javascript解构
https://zhuanlan.zhihu.com/p/268831227前半是解构的变量,其中father必须与后半部分的father一致,冒号后面的f,m是重新定义的替换变量名,= ‘1’、= ‘2’、= ‘3’是默认值,如果右侧有定义,默认值会被覆盖,不起作用。const { father: f = '1', mother: m = '2', child: c = '3'} = {father: '1',mother: '2'}> const { father: f1 = '原创 2021-03-20 17:46:01 · 156 阅读 · 0 评论 -
REACT生命周期方法的理解
REACT介绍文档第5节,讲了一些组件生命周期的函数,包括:componentDidMount()、componentWillUnmount(),第3节还介绍了render(),这些都是预定义函数。tick()是自定义函数,constructor()是构造函数。class Clock extends React.Component { constructor(props) { super(props); this.state = {date: new Date()}; }.原创 2021-03-16 16:54:16 · 216 阅读 · 0 评论 -
对REACT中JSX标签的误解
function Welcome(props) { return <h1>Hello, {props.name}</h1>;}const element = <Welcome name="Sara" />;ReactDOM.render( element, document.getElementById('root'));在 CodePen 上尝试让我们来回顾一下这个例子中发生了什么:我们调用ReactDOM.render()函数,...原创 2021-03-16 11:19:50 · 158 阅读 · 0 评论