当前位置:网站首页>State Hook
State Hook
2022-07-27 04:40:00 【Fallen leaves are also crazy】
1、State Hook Let function components also have state state , And read and write the state data
2、 grammar :const[xxx,setXxx]=React.useState(initValue)
3、useState() explain :
- Parameters : The first initialization of the specified value in the internal cache
- Return value : contain 2 Array of elements , The first 1 Are current status values within , The first 2 A function to update the state value
4、setXxx()2 Species writing :
- setXxx(newValue): The parameter is a non functional value , Directly specify the new state value , It is used internally to override the original state value
- setXxx(value => newValue): The number of parameters is , Receive the original status value , Returns the new status value , It is used internally to override the original state value
边栏推荐
- VSCode开启Pull Request更新代码分支可视化新篇章
- QString转换char*
- [final review of software engineering] knowledge points + detailed explanation of major problems (E-R diagram, data flow diagram, N-S box diagram, state diagram, activity diagram, use case diagram...)
- Redis interview question (2022)
- Use unity to build a WordArt system
- Okaleido ecological core equity Oka, all in fusion mining mode
- Yolov4 network details
- Standard C language 13
- Okaleido tiger will log in to binance NFT in the second round, or continue to create sales achievements
- Nacos startup and login
猜你喜欢

可视化领域 SVG

双向重发布实验

Anonymous named pipes, understanding and use of interprocess communication in shared memory

JS three methods of traversing arrays: map, foreach, filter

Easy to use shell shortcuts
![[machine learning network] BP neural network and deep learning-6 deep neural networks (DNN)](/img/6a/02c76f5bd35b2d89e4f471b9b688f5.png)
[machine learning network] BP neural network and deep learning-6 deep neural networks (DNN)

Database leader Wang Shan: strive for innovation and carefully Polish high-quality database products

BSN IPFs (interstellar file system) private network introduction, functions, architecture and characteristics, access instructions

Plato farm has a new way of playing, and the arbitrage eplato has secured super high returns

Scala immutable map, variable map, map conversion to other data types
随机推荐
无有线网络下安装并配置debian
[hcip] redistribute, redistribute and redistribute experiments
ISG index shows that the it and business service market in the Asia Pacific region fell sharply in the second quarter
结构型模式-适配器模式
Yolov4 network details
shel自动设置目录权限
Use unity to build a WordArt system
使用kubesphere图形界面dashboard开启devops功能
微信小程序编辑头像
Brightcove appoints Dan Freund as chief revenue Officer
Unity:Resource Merging、Static Batching、Dynamic Batching、GPU Instancing
Dry goods | how can independent station operation improve online chat customer service?
Effect Hook
Dino paper accuracy, and analyze the variant of its model structure & Detr
0动态规划中等 LeetCode467. 环绕字符串中唯一的子字符串
【AtCoder Beginner Contest 260 (A·B·C)】
Influxdb basic understanding
shell编程增强
els 方块显示原理
负数的右移