paol-imi / react-reparenting

The reparenting tools for React
https://paol-imi.github.io/react-reparenting
MIT License
481 stars 8 forks source link

Typescript errors on import #8

Closed Stevenlee731 closed 4 years ago

Stevenlee731 commented 4 years ago

Hi! I'm receiving compile errors when im importing Reparentable. This is on a fresh new Create React App with Typescript.

`TypeScript error in /Users/node_modules/react-reparenting/dist/types/core/addChild.d.ts(1,13): '=' expected. TS1005

1 | import type { Fiber } from 'react-reconciler'; | ^ 2 | /* 3 | Add a child fiber in a parent fiber and return the index in which it is added. 4 | * The position can be chosen by providing a key (string) or by providing an index (number).`

Deleted the tsconfig file and everything started to work.

Stevenlee731 commented 4 years ago

updating typescript from "~3.7.2" to "^3.9.3" fixed the issue for me.

brettinternet commented 4 years ago

This is likely related to https://github.com/typescript-eslint/typescript-eslint/issues/1436, however we might consider adding < 3.8 TypeScript support