index.tsx 837 B

12345678910111213141516171819202122232425262728
  1. import {Sparklines} from 'react-sparklines';
  2. import * as PropTypes from 'prop-types';
  3. /**
  4. * This is required because:
  5. *
  6. * - React.Suspense only works with default exports
  7. * - typescript complains that the library's `propTypes` does not
  8. * have `children defined.
  9. * - typescript also won't let us access `Sparklines.propTypes`
  10. */
  11. export default class SparklinesWithCustomPropTypes extends Sparklines {
  12. static propTypes = {
  13. children: PropTypes.node,
  14. data: PropTypes.array,
  15. limit: PropTypes.number,
  16. width: PropTypes.number,
  17. height: PropTypes.number,
  18. svgWidth: PropTypes.number,
  19. svgHeight: PropTypes.number,
  20. preserveAspectRatio: PropTypes.string,
  21. margin: PropTypes.number,
  22. style: PropTypes.object,
  23. min: PropTypes.number,
  24. max: PropTypes.number,
  25. onMouseMove: PropTypes.func,
  26. };
  27. }