Created
February 5, 2020 10:54
-
-
Save chitru/4e799f6ad1bb74caa81f4156a2e05431 to your computer and use it in GitHub Desktop.
MultiStepForm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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