import React from 'react'; interface Props { children: React.ReactNode; onSubmit?: any; [x: string]: any; } interface FormFieldProps { children: React.ReactNode; [x: string]: any; } function FormField(props: FormFieldProps) { const { children, ...rest } = props; return (
{children}
); } function Form(props: Props) { const { children, ...rest } = props; return (
{ e.preventDefault(); if (props.onSubmit) { props.onSubmit(e); } }} > {children}
); } Form.Field = FormField; export default Form;