-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Provide a general summary of the issue here
Basically to make types work better I as const the columns, which causes the <Row types to be better (I get a union of literals), but TableHeaderProps errors since it expects a mutable array
🤔 Expected Behavior?
Allow readonly arrays being passed
😯 Current Behavior
Readonly arrays not allowed
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
The type 'readonly [{ readonly id: "teamName"; readonly name: "Team"; }, { readonly id: "creator"; readonly name: "Creator"; }, { readonly id: "createdAt"; readonly name: "Created"; }, { readonly id: "status"; readonly name: "Status"; }]' is 'readonly' and cannot be assigned to the mutable type 'object[]'.ts(4104)
types.d.ts(1740, 5): The expected type comes from property 'columns' which is declared here on type 'IntrinsicAttributes & TableHeaderProps<object> & RefAttributes<HTMLTableSectionElement>'
(property) TableHeaderProps<object>.columns?: object[] | undefined
const columns = [{id: 1, col1: "col1"}] as const;
<TableHeader columns={columns}>
() => <div/>
</TableHeader>Version
1.0.0
What browsers are you seeing the problem on?
Safari
If other, please specify.
No response
What operating system are you using?
Mac OS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Reactions are currently unavailable