Skip to content

Commit e698087

Browse files
authored
Merge pull request #7735 from marmelab/fix-single-field-list-sx
Fix Support For sx Prop in SingleFieldList
2 parents fe30e98 + 0d3373b commit e698087

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import * as React from 'react';
2-
import { styled } from '@mui/material/styles';
2+
import { LinearProgress, styled, SxProps } from '@mui/material';
33
import {
44
cloneElement,
55
Children,
66
HtmlHTMLAttributes,
77
ComponentType,
88
} from 'react';
99
import PropTypes from 'prop-types';
10-
import LinearProgress from '@mui/material/LinearProgress';
1110
import {
1211
sanitizeListRestProps,
1312
useListContext,
@@ -124,6 +123,17 @@ SingleFieldList.propTypes = {
124123
// @ts-ignore
125124
linkType: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
126125
resource: PropTypes.string,
126+
sx: PropTypes.oneOfType([
127+
PropTypes.arrayOf(
128+
PropTypes.oneOfType([
129+
PropTypes.func,
130+
PropTypes.object,
131+
PropTypes.bool,
132+
])
133+
),
134+
PropTypes.func,
135+
PropTypes.object,
136+
]),
127137
};
128138

129139
export interface SingleFieldListProps<RecordType extends RaRecord = any>
@@ -137,6 +147,7 @@ export interface SingleFieldListProps<RecordType extends RaRecord = any>
137147
data?: RecordType[];
138148
total?: number;
139149
loaded?: boolean;
150+
sx?: SxProps;
140151
}
141152

142153
const PREFIX = 'RaSingleFieldList';

0 commit comments

Comments
 (0)