DEV Community

Discussion on: Server side pagination using react-table v7 and react-query v3

Collapse
 
koichadev profile image
Khoi Hoang • Edited

This helpful, but your code is hard to read. Is it possible you can refractor it to be easier to read? Like where you use useTableInstance custom hook, own custom provider with context and use Reducer, etc....

Edit:
I still want to give the credit to the original author who published the work. Without him, I couldn't get the chance to do this.

In case anyone wants the refactored version of mine: codesandbox.io/s/server-side-netwo...

Collapse
 
elangobharathi profile image
Elango Bharathi • Edited

Thanks for using this. The code style and purpose were majorly inspired from the examples from react query docs. The intent was to explain how this can be done in one file so that people can read and understand without navigating to multiple files.
Yes, of course, production grade code can always be written as and where it is seen fit.