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

      React children

      0

      0

      avatar
      Giovanny Gongora
      Codiga's TypeScript Recipes

      Define a button with ReactNode type for children

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.