class Test extends React.Component
{
construcrot(props)
{
super(props);
this.handleClick = (value) => this.handleClick.bind(this, value)
}
handleClick(object) {
}
render() {
const objectTest = {
id: 1,
name: 'Test-1'
}
};
}
return (
<div>
<input type="button" onClick={this.handleClick(objectTest)}>
</div>
);
}
}
return (
<input type="button" onClick={ this.handleClick.bind(this, objectTest) } />
);
class Test extends React.Component
{
handleClick = object => {
}
render() {
const objectTest = {
id: 1,
name: 'Test-1'
}
};
}
return (
<div>
<input type="button" onClick={this.handleClick(objectTest)}>
</div>
);
}
}