Skip to content
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

The column labels do not update when changed #27

Closed
thijssmudde opened this issue Mar 19, 2019 · 2 comments
Closed

The column labels do not update when changed #27

thijssmudde opened this issue Mar 19, 2019 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@thijssmudde
Copy link

Let's say there is a state like this

this.state = {
    data: [
        [{ value: 1 }, { value: 2 }, { value: 3 }, { value: 4 }], [{ value: 1 }, { value: 2 }, { value: 3 }, { value: 4 }]
    ],
    columnLabels: [1,2,3,4],
}

Then I want to update the state like this:

this.setState(({columnLabels}) => {
    columnLabels[0] = 'random value'
    return {columnLabels}
})

The column values do not rerender

@iddan
Copy link
Owner

iddan commented Mar 20, 2019

How are columnLabels passed to `?

@iddan iddan self-assigned this Mar 20, 2019
@iddan iddan added the question Further information is requested label Mar 20, 2019
@thijssmudde
Copy link
Author

I mean you could have guessed.

Like this
https://github.com/iddan/react-spreadsheet/blob/master/stories/withColumnLabels.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants