-
Notifications
You must be signed in to change notification settings - Fork 81
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
Row and Cells are re-rendering for all state changes, not just data. #82
Comments
same issue. blew lots of time blaming it on hooks. |
Same issue here! |
Same there, banging my head on the wall for a couple of days now trying to find a workaround to set a call back with a state change after a row selection. |
Thanks for reporting. |
It's strange. I can reproduce in this link: (React 16) but I couldn't reproduce in the Repo Example: (React 15) |
The Repo Example uses React 15, |
I've just fixed this bug (React 16 grid): componentDidUpdate called table.setData which kept re-rendering the grid. A check was put in to setData only when props data changed. |
My issue is similar... when updating state (no states var related to the table), all selected rows get unselected (rowSelectionChanged callback is called...). I have no clue on how to fix this tho... Only way to bypass is to avoid call to setState (which is kinda react anti-patter...). |
Hello Jmazier-2d Even I am facing the same issue. Did you find any solution for it? |
@Abhijeet501 @jmazier-j2d or somebody, can you post a Codesandbox example for troubleshooting? |
Hi, were you able to solve the problem? |
yes instead of adding columns directly into the react tabulator. I assigned it to null or empty like above example. Used separate method mapColumnsToGrid() to generate the required columns and then used setColumns to set it to Tabulator, this stopped columns and cells from re-rendering after every state change |
@Abhijeet501 Wow, it works! Thanks for your solution <3, |
Rows and Cell get re-rendered for all state changes
Short Description:
Environment Details
Long Description
In the example below, when editing data, I want to change the state to enable save button but when editing a large grid (30 columns, 10 rows) I noticed there was quite a bit of delay (1 sec?) when selecting the next column. If I remove the handleDataEdited prop, then it is very fast because the state doesn't get updated. I added the RowFormatter below to have it print a line in the console and sure enough, it prints for each row after setting the disabledSave in the state.
Code
Workaround
...
Please help with a PR if you have a solution. Thanks!
The text was updated successfully, but these errors were encountered: