Rewrote app to use hooks and fixed multiple re-renders.

This commit is contained in:
Patrick Fic
2019-12-11 18:39:27 -08:00
parent 5c7523e6bd
commit f333301f67
16 changed files with 162 additions and 193 deletions

View File

@@ -2,7 +2,6 @@ import React from "react";
import { auth } from "../../firebase/firebase.utils";
import { Form, Icon, Input, Button, Alert } from "antd";
import { UPSERT_USER } from "../../graphql/user.queries";
class SignInForm extends React.Component {
constructor() {
super();
@@ -24,16 +23,6 @@ class SignInForm extends React.Component {
password
);
apolloClient
.mutate({
mutation: UPSERT_USER,
variables: { authEmail: user.email, authToken: user.uid }
})
.then(r => console.log("Successful Upsert", r))
.catch(error => {
console.log("Upsert error!!!!", error);
});
this.props.form.resetFields();
} catch (error) {
this.setState({ ...this.state, errorMessage: error.message });