Skip to content

Commit 255bd4f

Browse files
authored
Merge pull request #6085 from marmelab/fix-form-props
Fix FormWithRedirect Props
2 parents 5b93fef + eede101 commit 255bd4f

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/ra-core/src/form/FormWithRedirect.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export type FormWithRedirectProps = FormWithRedirectOwnProps &
190190

191191
export type FormWithRedirectRenderProps = Omit<
192192
FormViewProps,
193-
'chilren' | 'render' | 'setRedirect'
193+
'children' | 'render' | 'setRedirect'
194194
>;
195195
export type FormWithRedirectRender = (
196196
props: FormWithRedirectRenderProps

packages/ra-ui-materialui/src/form/SimpleFormView.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as React from 'react';
2-
import { Children, FC, ReactElement } from 'react';
2+
import { Children, ReactElement, ReactNode } from 'react';
33
import classnames from 'classnames';
44
import FormInput from './FormInput';
55
import PropTypes from 'prop-types';
66
import { FormWithRedirectRenderProps, MutationMode, Record } from 'ra-core';
77
import Toolbar from './Toolbar';
88
import CardContentInner from '../layout/CardContentInner';
99

10-
export const SimpleFormView: FC<SimpleFormViewProps> = ({
10+
export const SimpleFormView = ({
1111
basePath,
1212
children,
1313
className,
@@ -27,7 +27,7 @@ export const SimpleFormView: FC<SimpleFormViewProps> = ({
2727
undoable,
2828
variant,
2929
...rest
30-
}) => (
30+
}: SimpleFormViewProps): ReactElement => (
3131
<form
3232
className={classnames('simple-form', className)}
3333
{...sanitizeRestProps(rest)}
@@ -98,6 +98,7 @@ SimpleFormView.defaultProps = {
9898

9999
export interface SimpleFormViewProps extends FormWithRedirectRenderProps {
100100
basePath?: string;
101+
children?: ReactNode;
101102
className?: string;
102103
component?: React.ComponentType<any>;
103104
margin?: 'none' | 'normal' | 'dense';

packages/ra-ui-materialui/src/form/TabbedFormView.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
cloneElement,
66
isValidElement,
77
ReactElement,
8+
ReactNode,
89
useState,
910
} from 'react';
1011
import PropTypes from 'prop-types';
@@ -22,7 +23,7 @@ import Toolbar from './Toolbar';
2223
import TabbedFormTabs, { getTabFullPath } from './TabbedFormTabs';
2324
import { ClassesOverride } from '../types';
2425

25-
export const TabbedFormView = (props: TabbedFormViewProps) => {
26+
export const TabbedFormView = (props: TabbedFormViewProps): ReactElement => {
2627
const {
2728
basePath,
2829
children,
@@ -183,6 +184,7 @@ TabbedFormView.defaultProps = {
183184

184185
export interface TabbedFormViewProps extends FormWithRedirectRenderProps {
185186
basePath?: string;
187+
children?: ReactNode;
186188
classes?: ClassesOverride<typeof useTabbedFormViewStyles>;
187189
className?: string;
188190
margin?: 'none' | 'normal' | 'dense';

0 commit comments

Comments
 (0)