Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

onclick on fragment react

const addClickToComponent = ({component}) => (
  React.cloneElement(component, {
    onClick: someComplicatedClickFunction,
  }
);

const ComponentWithClick = addClickToComponent(noClickComponent);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #onclick #fragment #react
ADD COMMENT
Topic
Name
6+7 =