Created
January 21, 2020 10:50
-
-
Save DmitryOlkhovoi/bdac120c08fe459ed008be875116d534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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