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

Docs reference Record type which does not exist #7560

Closed
hjr3 opened this issue Apr 16, 2022 · 1 comment · Fixed by #7563
Closed

Docs reference Record type which does not exist #7560

hjr3 opened this issue Apr 16, 2022 · 1 comment · Fixed by #7563
Labels

Comments

@hjr3
Copy link
Contributor

hjr3 commented Apr 16, 2022

What you were expecting:

See this example: https://marmelab.com/react-admin/doc/4.0/Upgrade.html#list-views

import { useGetList, Record } from 'react-admin';

I expected the Record type to exist. Note: It did exist in v3. I could do import { Record } from 'ra-core';.

What happened instead:

import { useGetList, Record } from 'react-admin';

generates this error: '"react-admin"' has no exported member named 'Record'

I am pretty sure the type should be RaRecord, according to the code here:

export interface RaRecord {
id: Identifier;
[key: string]: any;
}

Environment

  • React-admin version: v4
  • Last version that did not exhibit the issue (if applicable): v3
  • React version: NA
  • Browser: NA
  • Stack trace (in case of a JS error): '"react-admin"' has no exported member named 'Record'
@WiXSL WiXSL added the bug label Apr 16, 2022
@WiXSL WiXSL modified the milestone: 4.0.2 Apr 16, 2022
@WiXSL
Copy link
Contributor

WiXSL commented Apr 16, 2022

Thanks for reporting this!

You must use RaRecord instead of Record. This is also explained in the upgrade guide https://marmelab.com/react-admin/doc/4.0/Upgrade.html#record-was-renamed-to-rarecord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants