Skip to content

Updated docs examples/recommendations to use findDOMNode instead of getDOMNode #2802

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

Merged
merged 1 commit into from
Mar 6, 2015

Conversation

jimfb
Copy link
Contributor

@jimfb jimfb commented Jan 2, 2015

Updated docs examples/recommendations to use findDOMNode instead of getDOMNode

@jimfb
Copy link
Contributor Author

jimfb commented Jan 2, 2015

Code change was already merged here: #2646

This new pull request is for the docs update.

@waldreiter
Copy link
Contributor

Maybe add it to the Top-Level API doc as well?

@zpao zpao added this to the 0.13 milestone Jan 5, 2015
@zpao
Copy link
Member

zpao commented Jan 5, 2015

Yea, let's add the toplevel doc.

@@ -201,7 +201,7 @@ Use this as an opportunity to operate on the DOM when the component has been upd

> Note:
>
> Prior to v0.9, the DOM node was passed in as the last argument. If you were using this, you can still access the DOM node by calling `this.getDOMNode()`.
> Prior to v0.9, the DOM node was passed in as the last argument. If you were using this, you can still access the DOM node by calling `React.findDOMNode(this)`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's kill this note completely.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ping)

@zpao
Copy link
Member

zpao commented Mar 2, 2015

Alright, lets address the notes and add this to the top level API docs, then we can merge this.

@jimfb jimfb force-pushed the findDOMNode-in-docs branch from 324ccb4 to 61d2cf5 Compare March 6, 2015 00:20
@jimfb
Copy link
Contributor Author

jimfb commented Mar 6, 2015

@zpao good to go?

DOMElement findDOMNode(ReactComponent component)
```

Finds the native DOM element, if any, associated with the given ReactComponent.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just copy the text from here? http://facebook.github.io/react/docs/component-api.html#getdomnode

Maybe worth adding a note there too saying that React.findDOMNode is preferred.

@jimfb jimfb force-pushed the findDOMNode-in-docs branch 2 times, most recently from 036c843 to d157895 Compare March 6, 2015 00:36
@jimfb jimfb force-pushed the findDOMNode-in-docs branch from d157895 to 030fc75 Compare March 6, 2015 00:43
@jimfb
Copy link
Contributor Author

jimfb commented Mar 6, 2015

@spicyj better?

@sophiebits
Copy link
Collaborator

@JSFB shipit

jimfb added a commit that referenced this pull request Mar 6, 2015
Updated docs examples/recommendations to use findDOMNode instead of getDOMNode
@jimfb jimfb merged commit c7c2e05 into facebook:master Mar 6, 2015
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.

4 participants