You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tanner, in love with React Table! Thank you so much for creating it with your wisdom! Your talks have also been awesome at React Summit, etc!
Anyway, I've been using React Table for around 2 yrs, but I have a new implementation that I'm hoping you can quickly review when you have a couple of minutes. I just want to make sure I'm doing things properly and not causing un-necessary renders (currently 3 on initial load and any table setting update).
I've attached a zip that contains 2 jsx files. Table.jsx is my RT implementation that will be used across my app for any tables. UserList.jsx is an example of it's use. It works flawlessly, but I want to make sure I did everything in good practice. I know your docs mention memoizing most things, but I'm not doing this for my settings values that are coming in from Redux. You'll notice in UserList.jsx that I'm dispatching to Redux on most changes to the table made by the user.
Also, you'll notice my useRef/useEffect hack in Table.jsx for calling the dispatch when the sort changes. I'm not finding a good way to fire a custom func on sort change. I know there has to be a better way, but haven't found it yet.
You rock worlds, and thank you so much for your time! Cheers!
PS - Don't be upset that I'm using urql for my gql instead of React Query! RQ rocks too!!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
React_Table_Implementation.zip
Tanner, in love with React Table! Thank you so much for creating it with your wisdom! Your talks have also been awesome at React Summit, etc!
Anyway, I've been using React Table for around 2 yrs, but I have a new implementation that I'm hoping you can quickly review when you have a couple of minutes. I just want to make sure I'm doing things properly and not causing un-necessary renders (currently 3 on initial load and any table setting update).
I've attached a zip that contains 2 jsx files. Table.jsx is my RT implementation that will be used across my app for any tables. UserList.jsx is an example of it's use. It works flawlessly, but I want to make sure I did everything in good practice. I know your docs mention memoizing most things, but I'm not doing this for my settings values that are coming in from Redux. You'll notice in UserList.jsx that I'm dispatching to Redux on most changes to the table made by the user.
Also, you'll notice my useRef/useEffect hack in Table.jsx for calling the dispatch when the sort changes. I'm not finding a good way to fire a custom func on sort change. I know there has to be a better way, but haven't found it yet.
You rock worlds, and thank you so much for your time! Cheers!
PS - Don't be upset that I'm using urql for my gql instead of React Query! RQ rocks too!!
Beta Was this translation helpful? Give feedback.
All reactions