Add AuthContext to signup.js

This commit is contained in:
Ray 2023-09-19 10:50:06 +00:00 committed by GitHub
parent 1f39645265
commit b682d93e92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -2,8 +2,9 @@ import Form from 'react-bootstrap/Form';
import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import Button from "react-bootstrap/Button"
import {useState, useEffect} from 'react';
import Button from "react-bootstrap/Button";
import {useState, useEffect, useContext} from 'react';
import { AuthContext } from "../contexts/AuthContext";
export function Signup ( props ) {
const[username,setUsername] = useState('')
@ -12,6 +13,8 @@ export function Signup ( props ) {
const[validemail,setValidemail] = useState(false)
const[userpassword,setUserpassword] = useState('')
const[validpassword,setValidpassword] = useState(false)
const auth = useContext(AuthContext)
const submitHandler = (evt) => {
evt.preventDefault()