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

Old props while dispatching actions from cell #208

Open
mglombiowski opened this issue Mar 1, 2018 · 0 comments
Open

Old props while dispatching actions from cell #208

mglombiowski opened this issue Mar 1, 2018 · 0 comments

Comments

@mglombiowski
Copy link

I see in the code that the columns are set only once for component mount. This causes issues with passing dispatch methods.

Lets say that in each row there is a button, that will dispatch an action. Method itself is defined in higher order component and some additional props are passed there. Because the columns are set ony once, the attached method is keeping the old 'bind', so for example the new props will not apply.

Pseudocode:

submitAction() {
  console.log(this.props) // this.props will point to props that were passed on the first render
}
render() {
  <Grid columns=[
    renderer: <span onCllick={this.submitAction.bind(this)}/>
  ]/>
}

I cant imagine having every interactive cell as a container that will pick newest props on its own, nor passing a lot of additional data, not required for render in 'row' property.

@mglombiowski mglombiowski changed the title Dispatching actions from cell and caching columns infromation Old props while dispatching actions from cell Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant