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

Implement a data grid #595

Open
ygrishajev opened this issue Dec 30, 2024 · 3 comments
Open

Implement a data grid #595

ygrishajev opened this issue Dec 30, 2024 · 3 comments
Assignees

Comments

@ygrishajev
Copy link
Contributor

data-grid is a client-side pattern to render list data. we might want to consider using some existing solutions or implement our own. To my experience existing solutions are either paid or not easy to use. This task might involve some thinking/investigation stage.

Some acceptance criteria:

  • should be modular consisting of a data only react hook and a generic list component (using the hook) accepting a row template
  • should be implementing pagination on both the hook level and component level

The hook might look smth like:

function useDataGrid<T extends any>({ endpoint: string, params: QueryParams }): {
  data: T,
  isLoading: boolean,
  ...other state props,
  pagination: {
    hasNextPage: boolean,
    hasPreviousPage: boolean,
    nextPage: () => void,
    previousPage: () => void,
  }
}

The component interface might be accepting a template component or columns config with data getter, actions, etc.

@pcfreak30
Copy link

I am not sure how much react-table/react-query is being used but it feels like this implies re-implementing logic on a solved problem. If this is just a higher layer hook, I would suggest ensuring your just creating reusable abstractions/lego's.

@ygrishajev
Copy link
Contributor Author

@pcfreak30 I'm 100% for smth ready to use if it would apply to our use cases. As it's mentioned this task would require some investigation stage.
React table looks like smth we could use, so I'd say this would be smth to test for sure before jumping into own implementation.

@ygrishajev
Copy link
Contributor Author

ok, react table looks promising. pausing this as we need to fix some performance issues with grants fetching first

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

No branches or pull requests

2 participants