constructor(props) {
super(props)
this.state = {
signedIn: false,
name: "",
photoUrl: ""
}
}
uj5u.com熱心網友回復:
useState與默認值一起使用。
import { useState } from "react";
const Component = (props) => {
const [signedIn, setSignedIn] = useState(false);
const [name, setName] = useState("");
const [photoUrl, setPhotoUrl] = useState("");
return <></>
}
export { Component };
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/436925.html
標籤:javascript 反应 反应式
