constructor(props) {
super(props)
this.state = {
signedIn: false,
name: "",
photoUrl: ""
}
}
使用默认值的useState
。
import { useState } from "react";
const Component = (props) => {
const [signedIn, setSignedIn] = useState(false);
const [name, setName] = useState("");
const [photoUrl, setPhotoUrl] = useState("");
return <></>
}
export { Component };