Skip to content

Instantly share code, notes, and snippets.

@DmitryOlkhovoi
Created January 21, 2020 10:50
Show Gist options
  • Save DmitryOlkhovoi/bdac120c08fe459ed008be875116d534 to your computer and use it in GitHub Desktop.
Save DmitryOlkhovoi/bdac120c08fe459ed008be875116d534 to your computer and use it in GitHub Desktop.
...
const [rippleElements, setRippleElements] = useState<JSX.Element[]>([]);
...
function renderRippleElements() {
return rippleElements;
}
return (
<button
className={classNames}
{...props}
onClick={(event) => {
if (props.onClick) {
props.onClick(event);
}
if (ripple) {
onRippleClick(event);
}
}}
>
{children}
{renderRippleElements()}
</button>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment