constructor(props) {
super(props)
this.state = {
signedIn: false,
name: "",
photoUrl: ""
}
}
CodePudding user response:
Use useState
with default values.
import { useState } from "react";
const Component = (props) => {
const [signedIn, setSignedIn] = useState(false);
const [name, setName] = useState("");
const [photoUrl, setPhotoUrl] = useState("");
return <></>
}
export { Component };