Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export GridBodyReactRendererProps and others #284

Open
sissbruecker opened this issue Dec 17, 2024 · 0 comments
Open

Export GridBodyReactRendererProps and others #284

sissbruecker opened this issue Dec 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sissbruecker
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants