interface IButtonProps {
        reference?: React.RefObject<HTMLButtonElement>
      }
      const button = (props: IButtonProps) => {
        return (
          <button ref={props.reference} />
      	)
      }
      <Button reference={props.reference} />
      
      Typescript language logo

      React button element

      Codiga's TypeScript Recipes

      Pass down reference and apply the prop type to a Button

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.