-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Description
Discussed in #3648
Originally posted by Pavinati January 18, 2022
Seems like the table data prop is forced to be mutable. is it required to be mutable or is there a way around this?
type SomeRecord = Readonly<....>;
const columns: Column<SomeRecord>[] = [...];
type Props {
className?: string;
data: readonly SomeRecord[];
}
const MyTable = ({ className, data }: Props) => {
return <Table className={className} columns={columns} data={data} />;
};results in
The type 'readonly Readonly<SomeRecord>[]' is 'readonly' and cannot be assigned to the mutable type 'Readonly<SomeRecord>[]'. TS4104
```</div>
AndreyMZ