From 8bf28dbe435865b9eb5b186cd495689dbf1837da Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 18 Dec 2017 17:44:46 +0000 Subject: [PATCH] Document more instance methods in Direct Manipulation guide Fix #704 --- docs/guides/direct-manipulation.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/guides/direct-manipulation.md b/docs/guides/direct-manipulation.md index 5bd8696b..b9c24036 100644 --- a/docs/guides/direct-manipulation.md +++ b/docs/guides/direct-manipulation.md @@ -1,13 +1,13 @@ # Direct manipulation -React Native for Web provides several methods to directly access the underlying -DOM node. This can be useful when you need to make changes directly to a -component without using state/props to trigger a re-render of the entire -subtree, or when you want to focus a view or measure its on-screen dimensions. +React Native provides several methods to directly access the underlying host +node. This can be useful when you need to make changes directly to a component +without using state/props to trigger a re-render of the entire subtree, or when +you want to focus a view or measure its on-screen dimensions. The methods described are available on most of the default components provided -by React Native for Web. Note, however, that they are *not* available on the -composite components that you define in your own app. +by React Native for Web. Note, however, that they are *not* available on the composite +components that you define in your own app. ## Instance methods @@ -35,11 +35,17 @@ Like `measure`, but measures the view relative to another view, specified as `relativeToNativeNode`. This means that the returned `x`, `y` are relative to the origin `x`, `y` of the ancestor view. +As always, to obtain a native node handle for a component, you can use +`findNodeHandle(component)`. + +**measureInWindow**(callback: (x, y, width, height) => void) + +Determines the location of the given view in the window and returns the values +via an async callback. + **setNativeProps**(nativeProps: Object) -This function sends props straight to the underlying DOM node. See the [direct -manipulation](../guides/direct-manipulation.md) guide for cases where -`setNativeProps` should be used. +This function sends props straight to the underlying DOM node. ## About `setNativeProps`