vaadin / react-components

15 stars 4 forks source link

Accept React nodes for grid column header / footer #190

Closed tomivirkki closed 11 months ago

tomivirkki commented 11 months ago

The current API for using a React component for a Grid column's header requires using a headerRenderer function:

<GridColumn headerRenderer={() => <span>Header</span>} />

Simplify the API by making the header property in GridColumn accept a ReactNode, which could then be mapped to a renderer internally:

<GridColumn header={<span>Header</span>} />

A similar footer property (accepting a ReactNode) should also be added.

Here's an example (from Dialog) on how to implement it: https://github.com/vaadin/react-components/blob/764496a2443afa5f4cee074726a1f456a79e8728/src/Dialog.tsx#L24-L25