使用useEffect模拟componentDidMount
import React, {
useEffect, useState } from "react";
export default function Home() {
let [date, setDate] = useState({
count: 0 });
useEffect(() => console.log("useEffect DidMount")
使用useEffect模拟componentDidMount
import React, {
useEffect, useState } from "react";
export default function Home() {
let [date, setDate] = useState({
count: 0 });
useEffect(() => console.log("useEffect DidMount")