Created
February 5, 2020 10:58
-
-
Save chitru/6c275aecbe6dbe76be6be9ffd2fb2452 to your computer and use it in GitHub Desktop.
MultiStepForm
This file contains hidden or 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"; | |
| const ItemForm = ({ label, children, type = "text", ...otherProps }) => ( | |
| <div> | |
| {type === "text" ? ( | |
| <> | |
| <label>{label}</label> | |
| <input type={type} {...otherProps} /> | |
| </> | |
| ) : ( | |
| <> | |
| <label /> | |
| <input type={type} {...otherProps} /> | |
| {label} | |
| </> | |
| )} | |
| </div> | |
| ); | |
| export default ItemForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment