Skip to content

Commit f7746d0

Browse files
committedJun 1, 2022
Unleash generic typing restriction on FunctionField
#7702
1 parent c0d3aa9 commit f7746d0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎packages/ra-ui-materialui/src/field/FunctionField.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import { PublicFieldProps, InjectedFieldProps, fieldPropTypes } from './types';
1717
* render={record => record && `${record.first_name} ${record.last_name}`}
1818
* />
1919
*/
20-
export const FunctionField = <RecordType extends RaRecord = any>(
20+
21+
export const FunctionField = <RecordType extends unknown = any>(
2122
props: FunctionFieldProps<RecordType>
2223
) => {
2324
const { className, source = '', render, ...rest } = props;
@@ -45,7 +46,7 @@ FunctionField.propTypes = {
4546
render: PropTypes.func.isRequired,
4647
};
4748

48-
export interface FunctionFieldProps<RecordType extends RaRecord = any>
49+
export interface FunctionFieldProps<RecordType extends unknown = any>
4950
extends PublicFieldProps,
5051
InjectedFieldProps<RecordType>,
5152
Omit<TypographyProps, 'textAlign'> {

‎packages/ra-ui-materialui/src/field/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export interface PublicFieldProps {
2525
fullWidth?: boolean;
2626
}
2727

28-
// Props injected by react-admin
29-
export interface InjectedFieldProps<RecordType extends RaRecord = any> {
28+
export interface InjectedFieldProps<RecordType = any> {
3029
record?: RecordType;
3130
resource?: string;
3231
}

0 commit comments

Comments
 (0)
Please sign in to comment.