Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

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

Open
fea17e86 opened this issue Oct 16, 2018 · 2 comments
Open

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

fea17e86 opened this issue Oct 16, 2018 · 2 comments

Comments

@fea17e86
Copy link

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.

@sioked
Copy link
Contributor

sioked commented Nov 10, 2018

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.

@hueitan
Copy link

hueitan commented Sep 17, 2019

// 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

@ghost ghost deleted a comment Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants