INNER CODE UNIT · JavaScript

Button

react-boilerplate/react-boilerplate · app/components/Button/index.js:16

function Button(props) {
  // Render an anchor tag
  let button = (
    <A href={props.href} onClick={props.onClick}>
      {Children.toArray(props.children)}
    </A>
  );

  // If the Button has a handleRoute prop, we want to render a button
  if (props.handleRoute) {
    button = (
      <StyledButton onClick={props.handleRoute}>
        {Children.toArray(props.children)}
      </StyledButton>
    );
  }

  return <Wrapper>{button}</Wrapper>;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…