Skip to content

Commit f600a32

Browse files
elstgavTurtIeSocks
authored andcommitted
Match WithRecord types to FunctionField types
Matches changes implemented in marmelab#8964
1 parent 6824937 commit f600a32

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/ra-core/src/controller/record/WithRecord.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import { useRecordContext } from './useRecordContext';
1414
* </Show>
1515
* );
1616
*/
17-
export const WithRecord = <RecordType extends RaRecord>({
17+
export const WithRecord = <RecordType extends Record<string, unknown> = any>({
1818
render,
1919
}: WithRecordProps<RecordType>) => {
2020
const record = useRecordContext<RecordType>();
2121
return record ? render(record) : null;
2222
};
2323

24-
export interface WithRecordProps<RecordType extends RaRecord> {
24+
export interface WithRecordProps<
25+
RecordType extends Record<string, unknown> = any
26+
> {
2527
render: (record: RecordType) => ReactElement;
2628
label?: string;
2729
}

0 commit comments

Comments
 (0)