Skip to content

Instantly share code, notes, and snippets.

@pushkar100
Created April 12, 2022 07:54
Show Gist options
  • Select an option

  • Save pushkar100/1b8e9375775dcff35f2eb54e65b838a7 to your computer and use it in GitHub Desktop.

Select an option

Save pushkar100/1b8e9375775dcff35f2eb54e65b838a7 to your computer and use it in GitHub Desktop.
const buttonAriaPropCollection = {
tabIndex: 0,
role: "button",
"aria-disabled": false
};
const Button = ({ text, onClick, tabIndex, role, 'aria-disabled': ariaDisabled }) => {
return (
<button onClick={onClick} tabIndex={tabIndex} role={role} aria-disabled={ariaDisabled}>
{text}
</button>
);
};
// Usage:
{/*
<Button
text="click me"
onClick={() => console.log("Clicked")}
{...buttonAriaPropCollection}
/>
*/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment