Skip to content

Commit b60e770

Browse files
Fix: Improve code conventions for ReactNode
1 parent bddeb48 commit b60e770

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

packages/ra-core/src/controller/field/ReferenceArrayFieldBase.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ export interface ReferenceArrayFieldBaseProps<
170170
ReferenceRecordType extends RaRecord = RaRecord,
171171
> extends BaseFieldProps<RecordType> {
172172
children?: ReactNode;
173-
render?: (
174-
props: ListControllerResult<ReferenceRecordType>
175-
) => React.ReactNode;
173+
render?: (props: ListControllerResult<ReferenceRecordType>) => ReactNode;
176174
error?: ReactNode;
177175
loading?: ReactNode;
178176
empty?: ReactNode;

packages/ra-core/src/test-ui/SimpleFormIterator.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ export type DisableRemoveFunction = (record: RaRecord) => boolean;
9999
export const SimpleFormIteratorItem = React.forwardRef<
100100
any,
101101
Partial<ArrayInputContextValue> & {
102-
children?: React.ReactNode;
102+
children?: ReactNode;
103103
disabled?: boolean;
104104
disableRemove?: boolean | DisableRemoveFunction;
105105
disableReordering?: boolean;
106106
getItemLabel?: boolean | GetItemLabelFunc;
107107
index: number;
108108
inline?: boolean;
109109
record: RaRecord;
110-
removeButton?: React.ReactNode;
111-
reOrderButtons?: React.ReactNode;
110+
removeButton?: ReactNode;
111+
reOrderButtons?: ReactNode;
112112
resource?: string;
113113
source?: string;
114114
}
@@ -295,10 +295,10 @@ export const SimpleFormIterator = (props: SimpleFormIteratorProps) => {
295295
) : null;
296296
};
297297

298-
type GetItemLabelFunc = (index: number) => React.ReactNode;
298+
type GetItemLabelFunc = (index: number) => ReactNode;
299299

300300
export interface SimpleFormIteratorProps extends Partial<UseFieldArrayReturn> {
301-
addButton?: React.ReactNode;
301+
addButton?: ReactNode;
302302
children?: ReactNode;
303303
className?: string;
304304
readOnly?: boolean;
@@ -316,8 +316,8 @@ export interface SimpleFormIteratorProps extends Partial<UseFieldArrayReturn> {
316316
submitFailed?: boolean;
317317
};
318318
record?: RaRecord;
319-
removeButton?: React.ReactNode;
320-
reOrderButtons?: React.ReactNode;
319+
removeButton?: ReactNode;
320+
reOrderButtons?: ReactNode;
321321
resource?: string;
322322
source?: string;
323323
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { useResourceContext, useSplatPathBase } from 'ra-core';
2222
import { Toolbar } from './Toolbar';
2323
import { TabbedFormTabs, getTabbedFormTabFullPath } from './TabbedFormTabs';
2424

25-
export const TabbedFormView = (inProps: TabbedFormViewProps): ReactElement => {
25+
export const TabbedFormView = (inProps: TabbedFormViewProps) => {
2626
const props = useThemeProps({
2727
props: inProps,
2828
name: PREFIX,

packages/ra-ui-materialui/src/list/ListView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export interface ListViewProps<RecordType extends RaRecord = any> {
196196
* </List>
197197
* );
198198
*/
199-
aside?: React.ReactNode;
199+
aside?: ReactNode;
200200

201201
/**
202202
* A class name to apply to the root div element
@@ -318,7 +318,7 @@ export interface ListViewProps<RecordType extends RaRecord = any> {
318318
* </List>
319319
* );
320320
*/
321-
empty?: React.ReactNode;
321+
empty?: ReactNode;
322322

323323
/**
324324
* Set to true to return null while the list is loading.
@@ -404,7 +404,7 @@ export interface ListViewProps<RecordType extends RaRecord = any> {
404404
* </List>
405405
* );
406406
*/
407-
title?: React.ReactNode;
407+
title?: ReactNode;
408408

409409
/**
410410
* The CSS styles to apply to the component.

0 commit comments

Comments
 (0)