Skip to content

Export GridBodyReactRendererProps and others #284

@sissbruecker

Description

@sissbruecker

If you want to extract a renderer or memoize it using useCallback, you currently need to type the arguments manually as they can not be infered from the grid and types such as GridBodyReactRendererProps are not exported:

const toggleDetailsRenderer = ({ item }: { item: Person }) => {
  ...
};

That gets more complex if you want to use state from the model.

Instead this should be possible:

import type { GridBodyReactRendererProps } from '@vaadin/react-components';

const toggleDetailsRenderer = ({ item }: GridBodyReactRendererProps<Person>) => {
  ...
};

Maybe there should also be a GridReactBodyRenderer<T> that types the whole function.

Another concern is that web component types such as GridBodyRenderer are exported, which can be confusing because they can not be used with the React component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions