wet-aquaW
Refineβ€’4y agoβ€’
7 replies
wet-aqua

Error to include SSR page in resources list on _app.tsx

There is a warning if we use SSR page in resources on _app.tsx
For example to use list UserList to get users in sidebar menu:
resources={[
{ name: "users", list: UserList},
]}

Here the UserList is SSR page
export const UserList: React.FC<{ users: GetListResponse<IPost> }> = ({
users,
}) => {

We got the warning:
[{"message": "Type 'FC<{ users: GetListResponse<IPost>; }>' is not assignable to type 'FunctionComponent<IResourceComponentsProps<any, any, ILogData>>'.\n Types of property 'propTypes' are incompatible.\n Type 'WeakValidationMap<{ users: GetListResponse<IPost>; }> | undefined' is not assignable to type 'WeakValidationMap<IResourceComponentsProps<any, any, ILogData>> | undefined'.\n Type 'WeakValidationMap<{ users: GetListResponse<IPost>; }>' has no properties in common with type 'WeakValidationMap<IResourceComponentsProps<any, any, ILogData>>'.",
"message": "The expected type comes from property 'list' which is declared here on type 'ResourceProps'",
"resource": "/node_modules/@pankod/refine-core/dist/contexts/resource/IResourceContext.d.t.s"
}
]
}]

Thank you for the help!
Was this page helpful?