NJFFormProps
type NJFFormProps = {
id: string;
endpoint?: string;
customSubmit?: (formData: any) => Promise<NJFFormResponseType>;
children: ReactNode;
formProps: NJFFormType;
};
| Property | Type | Description |
|---|---|---|
| id | string* | Unique identifier for the form. Must be unique (in component scope). |
| endpoint | string? | A POST request with the form's data will be submitted to this endpoint. |
| customSubmit | (data: any) => Promise NJFFormResponseType ? | A custom function that will be called when the form is submitted with the form's data in JSON format as a parameter. |
| children | ReactNode* | Any node that will be rendered as a child. Can be any of NextJ inputs or any other component. |
| formProps | NJFFormType* | Custom NextJ interface that configures the form. |
* = Required
? = Optional