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

Update to react 15 (and all the other packages) #22

Merged
merged 4 commits into from Mar 21, 2017

Conversation

gavmck
Copy link
Contributor

@gavmck gavmck commented Mar 21, 2017

Hey there,

I was trying to use this plugin on a react 15.4.2 app and having difficulties with the call to findDOMNode. In the process of updating, it led me down a rabbithole where everything needed updating/tweaking.

Should be all good to go now and have switched findDOMNode to use ref function instead.

Should fix #20

@zackify
Copy link
Member

zackify commented Mar 21, 2017

Looks good to me, one little thing though

The ref attribute takes a callback function, and the callback will be executed immediately after the component is mounted or unmounted.

Is this before componentDidMount is called? I'm assuming so, which means everything would work perfect. Good job

@gavmck
Copy link
Contributor Author

gavmck commented Mar 21, 2017

Yep, should only be called after we know what's in render.

Initialization that requires DOM nodes should go here. 

https://facebook.github.io/react/docs/react-component.html#componentdidmount

@gavmck
Copy link
Contributor Author

gavmck commented Mar 21, 2017

Oh there's a more relevant example in the docs here: https://facebook.github.io/react/docs/refs-and-the-dom.html#adding-a-ref-to-a-class-component

@dphaener
Copy link

@gavmck This looks good! Thanks for working on this. I'm going to go ahead and merge and just do a few smoke tests locally, and if everything looks good I'll release shortly thereafter.

@dphaener dphaener merged commit 4d758ff into Legitcode:master Mar 21, 2017
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

Successfully merging this pull request may close these issues.

findDOMNode exploding with react 15
3 participants