79155489

Date: 2024-11-04 12:42:25
Score: 1
Natty:
Report link

This is what you need, I guess

type ColumnConfig<Row,Acc extends keyof Row = keyof Row> = {
  accessor: Acc;
  render: React.FC<{value: Row[Acc]}>;
}

const foo: ColumnConfig<{foo: 'bar'}> = {
  accessor: 'foo',
  render: ({value}) => <></> // Value type hint is 'bar'
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: João Bonsegno