-
Notifications
You must be signed in to change notification settings - Fork 934
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
Stop mutating column.options props and support immutable data object #997
Stop mutating column.options props and support immutable data object #997
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough!
Couple of minor issues.
-
The
'should correctly build internal table data and displayData structure when using nested data'
test is broken by the changes, I think because you missed also changing line 425 tooptions.sortDirection
. -
Line 412 is missing a semicolon which prevents webpack from compiling the project when running it in development.
@gabrielliwerant Fixed :) Sorry, I forgot to run test before push the change and didn't realize it breaks a test case. |
Looks like you accidentally pushed your local yarn lockfile with the last commit! I noticed when the line changes jumped by about 9k. :) |
316690f
to
c7a9d53
Compare
@gabrielliwerant removed 😅 Should we add |
@n3tr Hm, I guess that wouldn't hurt. Could also take it out if we switched to yarn in the future. I'll leave that up to you. |
@gabrielliwerant I will open separate PR for removing Do you know why TravisCI doesn't send the build status here? |
@n3tr Not sure. I actually don't have access to the CI administration for this library. My guess is that it just wasn't set up. |
@gabrielliwerant look like TravisCI deprecated Github commit status (https://blog.travis-ci.com/2018-09-27-deprecating-github-commit-status-api-for-github-apps-managed-repositories) and require owner to activate Travis CI app for this repo. |
…regnb#997) * Stop mutating colums props * Fix sortDirection condition and add semi-colon
…regnb#997) * Stop mutating colums props * Fix sortDirection condition and add semi-colon
I notice that the
MUIDataTable
is mutating the props.columns.options value and it causes error when passing an immutable object to it.Example, I'm using
immer
to update state and it produces immutable data object (using deep-freeze under the hood).I think it is better to not mutate the props values inside the component.
Change
props.columns.options
by spreadingcolumn.options
into new options before mutatingExample
https://codesandbox.io/s/dazzling-dijkstra-kmuf2