Closed
Description
Provide a general summary of the issue here
Props that take array's generally use the mutable form e.g. here the columns
https://github.com/adobe/react-spectrum/blob/main/packages/react-aria-components/src/Table.tsx#L529
🤔 Expected Behavior?
They instead be typed to take ReadonlyArray where the array is not mutated - that then allows the consumer to pass a mutable or a readonly array.
😯 Current Behavior
An error trying to assign a readonly array to a prop that takes a mutable array
💁 Possible Solution
Updating alot of T[]
-> ReadonlyArray<T>
🔦 Context
We use readonly arrays frequently to make sure no-one is mutating a value they shouldn't and causing a unintended side effect. The current design means we would need to add a typescript expect error to use readonly arrays or a cast.
🖥️ Steps to Reproduce
N/A
Version
N/A
What browsers are you seeing the problem on?
Other
If other, please specify.
No response
What operating system are you using?
N/A
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Metadata
Metadata
Assignees
Labels
No labels