bloomer icon indicating copy to clipboard operation
bloomer copied to clipboard

Typescript: Can't build with react-scripts-ts

Open fea17e86 opened this issue 6 years ago • 2 comments

Hi

I'm using create-react-app with react-scripts-ts. When I'm trying to start or build my project I get the following error:

Failed to compile.

node_modules/bloomer/lib/components/Breadcrumb/Breadcrumb.d.ts
(8,124): Type '{ className: string; accept?: string | undefined; acceptCharset?: string | undefined; action?: string | undefined; allowFullScreen?: boolean | undefined; allowTransparency?: boolean | undefined; ... 279 more ...; key?: string | ... 1 more ... | undefined; }' does not satisfy the constraint 'HTMLAttributes<HTMLElement>'.
  Types of property 'unselectable' are incompatible.
    Type 'boolean | undefined' is not assignable to type '"on" | "off" | undefined'.
      Type 'false' is not assignable to type '"on" | "off" | undefined'.

Do I have to modify my tsconfig to make bloomer work? I forked bloomer to look into the issue and couldn't even run bloomers build script because of multiple ts issues.

Thanks.

fea17e86 avatar Oct 16 '18 11:10 fea17e86

I made some changes in a different PR that got this working with TypeScript 2.9.2 and react-scripts-ts. There may be some additional errors on TypeScript 3.x but it should be worth trying. At some point in the future I'll test on 3.x and open a new PR if there are any other outstanding issues.

sioked avatar Nov 10 '18 13:11 sioked


// interface
interface buttonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {};

// component
const Button : React.FC<buttonProps> = ( props ) => <button { ...props } />;

Having the similar error when having the above script

hueitan avatar Sep 17 '19 13:09 hueitan