MrMirror21

fix not resetting bug

This diff is collapsed. Click to expand it.
......@@ -10,8 +10,6 @@ require('dotenv').config();
const axios = require('axios');
const API_KEY = process.env.REACT_APP_APIKEY;
console.log(API_KEY);
let imageFormData = new FormData();
export default function Main() {
const [imgBase64, setImgBase64] = useState("");
......@@ -33,6 +31,7 @@ export default function Main() {
}
const analysisImage = () => {
let imageFormData = new FormData();
imageFormData.append('file', img);
axios({
method: 'post',
......
import React from 'react'
import { Link } from 'react-router-dom';
import { useSetRecoilState } from 'recoil';
import logo from '../style/Logo.JPG';
import { selectedPosState, analysisResultState } from '../store/Global';
const Header = () => {
const setPosition = useSetRecoilState(selectedPosState);
const setResult = useSetRecoilState(analysisResultState);
const reset = () => {
setPosition('front');
setResult('loading');
}
return (
<div className="HeaderContainer"
style={{
......@@ -17,7 +25,7 @@ const Header = () => {
src={logo}
width='100px'
height='100px'
alt="Logo"></img>
alt="Logo" onClick={reset}></img>
</Link>
</div>
......