Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save chitru/6c275aecbe6dbe76be6be9ffd2fb2452 to your computer and use it in GitHub Desktop.
MultiStepForm
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