-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: correct container and baseElement typings #266
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
fix: correct container and baseElement typings #266
Conversation
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.
Oh nice! So a Node
is a subclass of HTMLElement
that has a firstChild
then?
|
I'm not 100% sure that is the best typing, but it accomplishes what we need as we aren't in full control of the renderer and it's typing. This is also the best I could find. It may break in the future if the response of react's renderer doesn't happen to match the API of a DOM Node. |
It be more accurate we would need to dig into React DOM more and determine what the actual typing of the render response is. |
Well, we're adding typings to |
The input types are different than the outputs because they are passed to the react renderer. When I dove into the renderer typings it just generically said |
Right but we create the container and |
Hmm, I tried it before and it wasn't working. I'll try with |
The hierarchy is (according to MDN): |
|
@kentcdodds, I'm still getting the does not exist error with
|
Same with just
|
Can you please show the full code that's failing for you? |
I'm working on building a Codesandbox that reproduces the error. However, it appears to be working fine there. Double checking what's different about my development environment. |
Ok, found my issue. Turns out my repo didn't list "dom" and "dom.iterable" in the lib section of my tsconfig. No type update is needed. I can look at updating the README to have a TypeScript settings section to avoid people hitting this in the future if you would like @kentcdodds. |
Yeah, some docs updates would be appreciated! |
adjusts the typings of container and baseElement to better correlate to their real world application. fixes #265.