Member-only story

React Formik and simple form validation.

Simuratli
Level Up Coding
Published in
4 min readApr 14, 2021

Let's start with creating react application in our local environment. For that we open the command line and go to a desktop folder using:

cd Desktop/

After that create react application with:

npx create-react-app testapp

After the React project is created on your computer, open it with the code editor you used and open the App.js file. Clear App.js file and copy it for starting.

export default function App() { return (    <div className="App">       <form>       <label htmlFor='name'>Name</label>
<input id='name' type='text' placeholder='Name' />
<label htmlFor='email'>Email</label>
<input id='email' type='email' placeholder='Email'/>
<button type='submit'>Submit</button> </form> </div>);}

This is the basic form for our application.

Let's add the formik package to our application. Open up the terminal write:

npm i formik

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Simuratli

MSc. High Energy and Plasma Physics | B.A. Computer Engineering | Content Creator. https://bento.me/simuratli

No responses yet

Write a response