Closed sMteX closed 3 years ago
@sMteX you might be right, so we should probably just set its type as LegacyDataProvider
:tada: This issue has been resolved in version @ra-data-prisma/dataprovider-v6.6.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
If I'm not mistaken,
buildDataProvider
returns the old version/interface of data provider - function(type, resource, params) => Promise<any>
(https://github.com/panter/ra-data-prisma/blob/master/packages/dataprovider/src/buildDataProvider.ts#L36), which corresponds to React Admin'sLegacyDataProvider
(https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/types.ts#L303)However, the return type of
useDataProvider
saysDataProvider
which has a different signature and cannot be casted (useDataProvider() as LegacyDataProvider
).Workaround is something like
(useDataProvider() as unknown) as LegacyDataProvider
which isn't very nice.