Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix FormWithRedirect Props #6085

Merged
merged 2 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ra-core/src/form/FormWithRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export type FormWithRedirectProps = FormWithRedirectOwnProps &

export type FormWithRedirectRenderProps = Omit<
FormViewProps,
'chilren' | 'render' | 'setRedirect'
'children' | 'render' | 'setRedirect'
>;
export type FormWithRedirectRender = (
props: FormWithRedirectRenderProps
Expand Down
7 changes: 4 additions & 3 deletions packages/ra-ui-materialui/src/form/SimpleFormView.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import { Children, FC, ReactElement } from 'react';
import { Children, FC, ReactElement, ReactNode } from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter warning

import classnames from 'classnames';
import FormInput from './FormInput';
import PropTypes from 'prop-types';
import { FormWithRedirectRenderProps, MutationMode, Record } from 'ra-core';
import Toolbar from './Toolbar';
import CardContentInner from '../layout/CardContentInner';

export const SimpleFormView: FC<SimpleFormViewProps> = ({
export const SimpleFormView = ({
basePath,
children,
className,
Expand All @@ -27,7 +27,7 @@ export const SimpleFormView: FC<SimpleFormViewProps> = ({
undoable,
variant,
...rest
}) => (
}: SimpleFormViewProps): ReactElement => (
<form
className={classnames('simple-form', className)}
{...sanitizeRestProps(rest)}
Expand Down Expand Up @@ -98,6 +98,7 @@ SimpleFormView.defaultProps = {

export interface SimpleFormViewProps extends FormWithRedirectRenderProps {
basePath?: string;
children?: ReactNode;
className?: string;
component?: React.ComponentType<any>;
margin?: 'none' | 'normal' | 'dense';
Expand Down
4 changes: 3 additions & 1 deletion packages/ra-ui-materialui/src/form/TabbedFormView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
cloneElement,
isValidElement,
ReactElement,
ReactNode,
useState,
} from 'react';
import PropTypes from 'prop-types';
Expand All @@ -22,7 +23,7 @@ import Toolbar from './Toolbar';
import TabbedFormTabs, { getTabFullPath } from './TabbedFormTabs';
import { ClassesOverride } from '../types';

export const TabbedFormView = (props: TabbedFormViewProps) => {
export const TabbedFormView = (props: TabbedFormViewProps): ReactElement => {
const {
basePath,
children,
Expand Down Expand Up @@ -183,6 +184,7 @@ TabbedFormView.defaultProps = {

export interface TabbedFormViewProps extends FormWithRedirectRenderProps {
basePath?: string;
children?: ReactNode;
classes?: ClassesOverride<typeof useTabbedFormViewStyles>;
className?: string;
margin?: 'none' | 'normal' | 'dense';
Expand Down