Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[TypeScript] Fix error when using typed args in <WithRecord render> function #9552

Merged
Merged
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
4 changes: 2 additions & 2 deletions packages/ra-core/src/controller/record/WithRecord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* </Show>
* );
*/
export const WithRecord = <RecordType extends Record<string, unknown> = any>({
export const WithRecord = <RecordType extends Record<string, any> = any>({
render,
}: WithRecordProps<RecordType>) => {
const record = useRecordContext<RecordType>();
return record ? <>{render(record)}</> : null;
};

export interface WithRecordProps<

Check failure on line 24 in packages/ra-core/src/controller/record/WithRecord.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Replace `⏎····RecordType·extends·Record<string,·any>·=·any⏎` with `RecordType·extends·Record<string,·any>·=·any`
RecordType extends Record<string, unknown> = any
RecordType extends Record<string, any> = any
> {
render: (record: RecordType) => ReactNode;
label?: string;
Expand Down
Loading