pupudu / window-table

Windowing Table for React based on React Window
https://window-table.netlify.com/
170 stars 13 forks source link

move TableBody definition outside of render function #53

Closed hipstersmoothie closed 4 years ago

hipstersmoothie commented 4 years ago

I found that if I define a component renderer within a render function, state updates cause the focus to be lost. I found this issue in the underlying library as well.

Tested this in my app and with TableBody outside of the render function the focus is retained.

Simplified Example:

https://codesandbox.io/s/aged-meadow-54jt9?file=/src/index.js

pupudu commented 4 years ago

This is good stuff. Thanks again mate