Skip to content

Instantly share code, notes, and snippets.

@chitru
Created February 5, 2020 10:54
Show Gist options
  • Save chitru/4e799f6ad1bb74caa81f4156a2e05431 to your computer and use it in GitHub Desktop.
Save chitru/4e799f6ad1bb74caa81f4156a2e05431 to your computer and use it in GitHub Desktop.
MultiStepForm
import React from "react";
import ItemForm from "./ItemForm";
import StateDrop from "./StateDrop";
const Address = ({ setForm, formData, navigation }) => {
const { address, city, state, zip } = formData;
const { previous, next } = navigation;
return (
<div className="form">
<h3>Address</h3>
<ItemForm
label="Address"
name="address"
value={address}
onChange={setForm}
/>
<ItemForm label="City" name="city" value={city} onChange={setForm} />
<StateDrop label="State" name="state" value={state} onChange={setForm} />
<ItemForm label="Zip" name="zip" value={zip} onChange={setForm} />
<div>
<button onClick={previous}>Previous</button>
<button onClick={next}>Next</button>
</div>
</div>
);
};
export default Address;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment