Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript declaration #158

Open
blpraveen opened this issue Jul 17, 2021 · 0 comments
Open

Typescript declaration #158

blpraveen opened this issue Jul 17, 2021 · 0 comments

Comments

@blpraveen
Copy link

I just used with typescript it fails

I created a declaration file index.d.ts inside types/d3-funnel
But I get an error
declare module 'd3-funnel'

{
   "compilerOptions": {
     "target": "es5",
     "typeRoots": [ "./types", "./node_modules/@types"],
     "lib": [
       "dom",
       "dom.iterable",
       "esnext"
     ],
     "allowJs": true,
     "skipLibCheck": true,
     "esModuleInterop": true,
     "allowSyntheticDefaultImports": true,
     "strict": true,
     "forceConsistentCasingInFileNames": true,
     "noFallthroughCasesInSwitch": true,
     "module": "esnext",
     "moduleResolution": "node",
     "resolveJsonModule": true,
     "isolatedModules": true,
     "noEmit": true,
     "jsx": "react-jsx"
   },
   "include": [
     "src"
   ],
   "exclude": [
         "./node_modules",
         "./types"
     ]
 }


Type 'RefObject<unknown>' is not assignable to type 'LegacyRef<HTMLDivElement> | undefined'.
  Type 'RefObject<unknown>' is not assignable to type 'RefObject<HTMLDivElement>'.
    Type 'unknown' is not assignable to type 'HTMLDivElement'.  TS2322

    46 |     render() {
    47 |        
  > 48 |   		return (<div className="funnel__chart" ref={this.chartRef}></div>);
       |   		                                       ^
    49 |     }
    50 | }
    51 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant