Skip to content

Instantly share code, notes, and snippets.

@chitru
Created February 5, 2020 10:52
Show Gist options
  • Select an option

  • Save chitru/c7ae01ae70c4b2129e0dc814dfd86fdb to your computer and use it in GitHub Desktop.

Select an option

Save chitru/c7ae01ae70c4b2129e0dc814dfd86fdb to your computer and use it in GitHub Desktop.
Multistep form
import React from "react";
import ItemForm from "./ItemForm";
const Names = ({ setForm, formData, navigation }) => {
const { firstName, lastName, nickName } = formData;
const { next } = navigation;
return (
<div className="form">
<img
src="https://fiverr-res.cloudinary.com/images/q_auto,f_auto/gigs/52013919/original/6d1a3ad91335506330189dafa780af958fd03f50/draw-you-a-cute-drawing-in-my-style.jpg"
alt="img"
className="imageCover"
/>
<ItemForm
label="First Name"
name="firstName"
value={firstName}
onChange={setForm}
/>
<ItemForm
label="Last Name"
name="lastName"
value={lastName}
onChange={setForm}
/>
<ItemForm
label="Nick Name"
name="nickName"
value={nickName}
onChange={setForm}
/>
<div>
<button onClick={next}>Next</button>
</div>
</div>
);
};
export default Names;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment