Я пытаюсь запустить класс Buttons с передачей значения методу visibleFilter(value){...} и получаю сообщение об ошибке
Warning: _renderNewRootComponent(): Render methods should be a pure function of props and state;
triggering nested component updates from render is not allowed.
If necessary, trigger nested updates in componentDidUpdate.
Check the render method of Buttons.
Мой код следующий:
class Buttons extends React.Component {
visibilityFilter(value){
let action = {type: 'set_visibility_filter',payload: {name: value, on: true}};
store.dispatch(action);
};
render(){
return(
<div className="container-fluid">
<div className="row">
<div className="col-lg-4 col-md-4 col-sm-4 col-xs-0">
<buttom type="button" className="m-t-1-em w-100 btn btn-info" onClick={this.visibilityFilter('favorite')} >Favorite</buttom>
</div>
</div>
</div>
);
};
};
В чем дело и как передать значение методу?