Im trying to convert one of my components to a functional stateless component (FSC).
But FSC will not be optimized if using ...rest
, therefore i need to destruct the components props.
I call Link as
<Link to={link} data-navbar-click="close-menu">{name}</Link>
then in Link i want to destruct the hyphen cased> data-navbar-click prop:
function Link({ to, className, onClick, target, rel, key, data-navbar-click}) {
However that doesnt compile. So i tried:
function Link({ to, className, onClick, target, rel, key, ['data-navbar-click']}) {
But that doesnt work as well.