-
Notifications
You must be signed in to change notification settings - Fork 94
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 defs for Helper Functions with Hooks #72
Comments
I did some more research. I had previously imported the component like so:
It seems like the components on the
I got a TS error:
All three components (Fulfilled, Pending, Rejected) show as unavl in the typescript defs. Also, my app does not compile, with this error:
|
Hey, thanks for reporting. The problem is with a naming collision between the stand-alone I have a fix for this ready, see #73 Care to review? |
Interesting. Your commit seems to resolve the TS error. Does TS by default export class methods as their base name? Confused as to why I'll test the compilation in a few hours after a meeting. Thanks for the help! |
@ghengeveld here's the error I'm getting now:
No Typescript errors though. I'm using the |
@ghengeveld do you have a process for linking the libraries locally? Would be willing to add that into contributing.md.
|
Yes, it uses Don't use |
Thanks, I haven't heard of I have to say, using React Async has been an eye-opener for me. Async calls in React always felt like too much boilerplate, no matter which solution. This library is refreshingly flexible and seemingly future-proof! Kudos. |
Thanks! |
Hey, can you try out It can also be installed as |
* Fix ambiguous import issue by renaming the standalone helper components. Improved the TS type definitions. * Update example to use standalone helpers. * Add codemods for breaking API changes. * ES modules don't work from a codemod URL. * Ignore node_modules in cwd. * Improve types for promiseFn/deferFn props. * Bump and align all package versions.
Released in v8.0.0 Thanks for helping out! |
The README shows a declarative approach to writing hook-based react-async resolvers. However, if implemented with Typescript, the following error appears:
Going into the definitions, it seems like
state
isn't considered a prop that is passed through. The same goes forPending
andFufilled
components.The text was updated successfully, but these errors were encountered: