-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
types: export ProviderProps from Provider component #41
Conversation
exported ProviderProps to allow the usage anywhere needed (specially on reakit)
Codecov Report
@@ Coverage Diff @@
## master #41 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 115 115
Branches 31 31
=====================================
Hits 115 115
Continue to review full report at Codecov.
|
Hey, @playma256. I guess we need to export it in |
Oh, yeah... i totally messed up. I saw that but my mind thought it was using |
@@ -3,5 +3,6 @@ import Container from "./Container"; | |||
import Provider from "./Provider"; | |||
|
|||
export * from "./types"; | |||
export * from "./Provider"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, i've searched and also opened a question on stackoverflow, i got a good direction on what is going wrong if we do: import {interface} from 'a'
and export {interface}
.
The discussion is on this Github issue: babel/babel-loader#603
and also https://stackoverflow.com/questions/52258061/export-not-found-on-module/52260432#52260432
The real problem is that "Re-exporting types is one of the known TypeScript constructs that don't work when using Babel to compile TypeScript because they require cross-file information". isolatedModules
flag could be set on tsc, but that does not work generating type definitions.
Basically, there are 2 options:
export * from 'file'
import Something {interface} from 'file';
export {Something};
export type InterfaceType = interface;
There is a 3rd one, but it hacky.
I prefered the first one because it is clean. If the second one is preferable, i can change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @playma256 ❤️
Export ProviderProps type which allows users to type anything needed.
Part of ariakit/ariakit#219