Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stateless Button with arrow binding - But this creates a new instance on every render?
import React from 'react';
function handleClick(label) {
alert('clicked ' + label);
}
function Button({label}) {
return (
<button onClick={(event) => handleClick(label)}>{label}</button>
);
}
export default Button;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.