SearchHeaderCell Type not accepting flex properties
Evergreen uses flex as a way of defining column width. TextHeaderCell and HeaderCell both accept flexBasis/flex/flexGrow without typescript errors. SearchHeaderCell results in the following error:
Type '{ flexBasis: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<SearchTableHeaderCell> & Readonly<SearchTableHeaderCellProps> & Readonly<{ children?: ReactNode; }>'.
Property 'flexBasis' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<SearchTableHeaderCell> & Readonly<SearchTableHeaderCellProps> & Readonly<{ children?: ReactNode; }>'. [2322]
How to Reproduce
- Action: compiling code with a flex property on a
SearchHeaderCelltag - Version:
4.21.2
Ah, looks like SearchTableHeaderCell props should extend TableHeaderCellProps (omitting own props), and TableHeaderCellProps should extend TableCellProps (omitting own props) and TableCellProps should extend React.ComponentProps<typeof Pane>
Hmm, im confused. Doesn't it do that? https://github.com/segmentio/evergreen/blob/master/index.d.ts#L1371
It looks like the heredity tree goes: SearchTableHeaderCellProps --> TableHeaderCellProps --> TableCellProps --> PaneProps , which should work.... but it's very possible im missing something
It might have to do with the way PaneProps is using typeof Box. What version of typescript are you on?
TypeScript Version 3.4.5
What typescript version would avoid this issue? I'm experiencing the same on 3.4.5
Any update on this?
Still waiting on this
I'm unable to reproduce the error using latest evergreen or on TypeScript 3.7.5+