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

dom_node does not work on native components #110

Open
catmando opened this issue Dec 22, 2015 · 1 comment
Open

dom_node does not work on native components #110

catmando opened this issue Dec 22, 2015 · 1 comment

Comments

@catmando
Copy link
Collaborator

i.e. if you use ref to get the id of say a "div" then you can't say ref["my_div"].dom_node as you would expect.

class Foo < React::Component::Base
  after_mount do
    refs[:my_div].dom_node # is nil!
  end
  def render
    div(ref: :my_div) { "no can do" }
  end
end

seems like the ref is pointing some ruby object which is just a simple wrapper around the native object... not sure how to solve.

For now work around is to do this:

`React.findDOMNode(#{refs[:my_div].to_n})` # === refs[:my_div].dom_node
@sollycatprint
Copy link

This issue was moved to ruby-hyperloop/hyper-react#110

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