Type error when inferring the type of ReadonlyArray
s returned from useLoaderData
#3762
Labels
ReadonlyArray
s returned from useLoaderData
#3762
What version of Remix are you using?
1.6.5
Steps to Reproduce
I've reproduced it as a minimal fork of the stackblitz remix starter - https://stackblitz.com/edit/node-d35hmw
ReadonlyArray
from a loaderuseLoaderData<typeof loader>()
Expected Behavior
The array should be typed correctly and methods such as
array.map
should be allowed. Either the array should come through typed asArray
or asReadonlyArray
Actual Behavior
the object is typed as a bare object with numeric properties and lacking all array methods.
The text was updated successfully, but these errors were encountered: