Skip to content
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

Support findDOMNode #88

Closed
steelbrain opened this issue Mar 13, 2016 · 6 comments
Closed

Support findDOMNode #88

steelbrain opened this issue Mar 13, 2016 · 6 comments

Comments

@steelbrain
Copy link

I have a use case where my components are given HTMLElements and I have to append them to the component. My usage is blocked because of this

See it on React Docs

@steelbrain steelbrain changed the title Support getDOMNode Support findDOMNode Mar 13, 2016
@developit
Copy link
Member

Hi - Component#getDOMNode() and .findDOMNode() are both supported in preact-compat. Preact simply exposes your DOM Node as this.base within any component.

@steelbrain
Copy link
Author

Wow, I looked into preact-markup and not in compat, sorry about that 🙇

@developit
Copy link
Member

No problem :) I am not against potentially adding a proper API for this (this.base is something I came up with and not supported by React), but I'd like to wait until things shake out a bit with React's API changes to see what they end up standardizing on. For reference, here's the implementation in preact-compat.
Cheers!

@steelbrain
Copy link
Author

I don't really need anything else from preact-compat other than this method, are you going to keep compatibility in .base via semver? Is it okay to use it in my project?

@developit
Copy link
Member

It will work indefinitely, and yes a major version change would occur if it were changed in any way. I'm using .base in nearly all of my projects, you can definitely consider it a safe part of the API. Preact is very careful about exposing things, anything you have access to is part of the versions, public API.

@steelbrain
Copy link
Author

Beautiful, Thank you for your awesome project 👍

marvinhagemeister added a commit that referenced this issue Mar 2, 2019
Fix incorrect state mutation on mount
marvinhagemeister added a commit that referenced this issue Mar 15, 2022
Support createContext of preact x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants