fbredius/storybook

View on GitHub
examples/react-ts-webpack4/src/button.tsx

Summary

Maintainability
A
1 hr
Test Coverage
import React, { ButtonHTMLAttributes } from 'react';

export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
  /**
   * A label to show on the button
   */
  label: string;
}

export const Button = ({ label = 'Hello', ...props }: ButtonProps) => (
  <button type="button" {...props}>
    {label}
  </button>
);