-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add types to compat
#1609
Add types to compat
#1609
Conversation
* Map and for each abstraction
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.
Awesome, this is a really great start 👍 💯 All types are there and we just need to make sure we're consistent and keep the types for props
👍 One nit: We don't have a space after a function name in our whole codebase: function foo () {}
should be formatted like function foo() {}
. Left a few comments with ideas for more type-safe declarations. Let me know what you think 🙂
@marvinhagemeister thanks. Ya this is my first foray into adding types to a larger package. And I'll fix the spacing thing too! |
I just changed over from using @marvinhagemeister does this seem ok? |
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.
Nice, This is looking great 👍
It's coming along very well! I'd just add the default export like mentioned in the comments and than it's ready to be merged in my opinion 👍 |
I did some testing and it seems as though the way the import React, { createPortal } from 'preact/compat';
React.createPortal(); // gives missing args, vnode not provided
createPortal(); // same message as above Both of those behave the same, plus intellisense over |
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.
Sweet ⚡✔️
This is still a WIP of adding export types with
preact/compat
for those that wish to use import things directly through compat.Some things are still being hashed out, but wanted some feedback.
Related #1608