<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>createRef的使用</title>
<style>
.title{
width: 200px;
background-color: coral;
}
</style>
</head>
<body>
<!-- 准备一个"容器" -->
<div id="test"></div>
<!-- 引入react核心库 -->
<script type="text/javascript" src="../js/react.development.js"></script>
<!-- 引入react-dom 用于支持react操作dom -->
<script type="text/javascript" src="../js/react-dom.development.js"></script>
<!-- 引入babel 用于将ajax转为js -->
<script type="text/javascript" src="../js/babel.min.js"></script>
<!-- 引入prop-types 用于对组件标签属性进行限制 -->
<script type="text/javascript" src="../js/prop-types.js"></
事件处理 ref使用场景 受控组件与非受控组件
最新推荐文章于 2023-08-18 15:00:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)