我如何在react native中的函数组件中写这篇文章


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 };

最新更新