-
I tried to solve the problem when loading data by using defer in the loader function.
-
I don’t know how to set the postResponse type, which is the actual response data.
-
Even if I try type casting or giving any, it doesn’t work.
This is the code of the loader function.
This is the code where an error occurs.
This is an error message!!
Type ‘({ postResponse }: { postResponse: GetPosts;}) => void’ is not assignable to type ‘ReactNode | AwaitResolveRenderFunction’.
Type ‘({ postResponse }: { postResponse: GetPosts;}) => void’ is not assignable to type ‘AwaitResolveRenderFunction’.
Type ‘void’ is not assignable to type ‘ReactNode’.ts(2322)
components.d.ts(137, 5): The expected type comes from property ‘children’ which is declared here on type ‘IntrinsicAttributes & AwaitProps’
(property) postResponse: GetPosts
If there is anything strange about my code, please let me know.
I thought it would be possible to access the data through postResponse without an error occurring.
Even if I search, I won’t find any similar cases.
A lot of time was spent. I would appreciate your help.
user24266491 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.