React button element

    0

    0

    Giovanny Gongora

    Codiga's TypeScript Recipes

    Pass down reference and apply the prop type to a Button

    interface IButtonProps {
      reference?: React.RefObject<HTMLButtonElement>
    }
    const button = (props: IButtonProps) => {
      return (
        <button ref={props.reference} />
    	)
    }
    <Button reference={props.reference} />
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.