Skip to content

Commit 52861bd

Browse files
committed
feat(forms): allow custom form actions
1 parent 8dbe04c commit 52861bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/forms/Form.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function Form({
88
cancelLabel,
99
children,
1010
customValidation,
11+
customActions,
1112
initialValues,
1213
onCancel,
1314
onSubmit,
@@ -58,7 +59,7 @@ export function Form({
5859
<form {...formProps}>
5960
<FormContext.Provider value={formState}>{children}</FormContext.Provider>
6061

61-
<FormActions {...{ submitLabel, cancelLabel, onCancel: handleCancel }} />
62+
{customActions || <FormActions {...{ submitLabel, cancelLabel, onCancel: handleCancel }} />}
6263
</form>
6364
);
6465
}
@@ -73,6 +74,7 @@ Form.propTypes = {
7374
cancelLabel: PropTypes.string,
7475
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
7576
customValidation: PropTypes.bool,
77+
customActions: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
7678
initialValues: PropTypes.object,
7779
onCancel: PropTypes.func.isRequired,
7880
onSubmit: PropTypes.func.isRequired,

0 commit comments

Comments
 (0)