Skip to content

Instantly share code, notes, and snippets.

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

  • Save pushkar100/0372fac17119f62a7520d74fa8c9ceb1 to your computer and use it in GitHub Desktop.

Select an option

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