Label.tsx 412 B

12345678910111213141516171819
  1. import React, { PureComponent, ReactNode } from 'react';
  2. interface Props {
  3. children: ReactNode;
  4. htmlFor?: string;
  5. className?: string;
  6. }
  7. export class Label extends PureComponent<Props> {
  8. render() {
  9. const { children, htmlFor, className } = this.props;
  10. return (
  11. <label className={`custom-label-class ${className || ''}`} htmlFor={htmlFor}>
  12. {children}
  13. </label>
  14. );
  15. }
  16. }