bietkul / react-reactive-form

Angular like reactive forms in React.
MIT License
309 stars 32 forks source link

Unable to import FormBuilder via Typescript #27

Closed dannyhuly closed 5 years ago

dannyhuly commented 5 years ago

Hi, I'm trying to use react-reactive-form in a .tsx but i'm unable to import FormBuilder or anything under the react-reactive-form module.

The only thing that i'm able to import is AbstractControl.

Thanks

bietkul commented 5 years ago

I don't know what can be the issue with you but I have a working example with typescript. https://codesandbox.io/s/4rxokpr270

dannyhuly commented 5 years ago

The sandbox allows you to import whatever you like (see: https://codesandbox.io/s/l92k6kwox9). In addition in the following example https://codesandbox.io/s/j4wpwyv71v uses webpack and ts and still no luck with the imports.

The fix is to remove the declare module 'react-reactive-form' from the index.d.ts.

I would open a PR but Github is a bit wonky today.