📜  这个 setstate 以前的状态反应 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:08.029000             🧑  作者: Mango

代码示例2
import React, { useState } from "react";
import ReactDOM from "react-dom";

function Counter() {
  const [count, setCount] = useState(0);

  return (
    

{count}

); } const rootElement = document.getElementById("root"); ReactDOM.render(, rootElement);