Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Formik, FormikProps } from "formik";
- import React, { PureComponent, ReactNode } from "react";
- export interface Props {
- component: ReactNode; // TODO: Change to one of LoginForm or RegisterForm.
- handleSubmit(): void;
- }
- export class Form extends PureComponent<Props> {
- renderForm = (formikProps: FormikProps<any>): ReactNode => {
- const { component: FormComponent } = this.props;
- return <FormComponent {...formikProps} />;
- };
- render() {
- const { handleSubmit } = this.props;
- return <Formik render={this.renderForm} />;
- }
- }
- export default Form;
- [ts] JSX element type 'FormComponent' does not have any construct or call signatures.
Add Comment
Please, Sign In to add comment