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
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.
The text was updated successfully, but these errors were encountered:
mglombiowski
changed the title
Dispatching actions from cell and caching columns infromation
Old props while dispatching actions from cell
Mar 1, 2018
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:
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.
The text was updated successfully, but these errors were encountered: