Skip to content

Instantly share code, notes, and snippets.

View Gauthamjm007's full-sized avatar
🐼
My code might be messy, but at least it's commented well... ish.

Goutham JM Gauthamjm007

🐼
My code might be messy, but at least it's commented well... ish.
View GitHub Profile
import React from "react";
import { Field, reduxForm } from "redux-form";
const Login = (props) => {
const { handleSubmit, pristine, reset, submitting } = props;
return (
<form onSubmit={handleSubmit}>
<div>
<label>Email</label>
<div>
@Gauthamjm007
Gauthamjm007 / Login.js
Created May 23, 2020 10:51
React hooks form ,login component
import React from "react";
import { useForm } from "react-hook-form";
const Login = () => {
const { handleSubmit, register, errors } = useForm();
const onSubmit = (values) => console.log(values);
return (
<form onSubmit={handleSubmit(onSubmit)}>
<input
@Gauthamjm007
Gauthamjm007 / Register.js
Created May 23, 2020 09:38
Formik Login Page example
import React from "react";
import { Formik } from "formik";
const Login = () => (
<div>
<h3>Login</h3>
<Formik
initialValues={{ email: "", password: "" }}
validate={(values) => {
const errors = {};
if (!values.email) {