Add example of getting window dimensions to Dimensions docs.
Summary: This pull request adds an example to the Dimensions documentations. Specifically, it gives an example of how to get the height and width from the window. I'm submitting this documentation because discovering this information cost me some time and my hope is to save other folks time by having this info right in the docs generated from the comments in this file. Let me know if you need anything else. Closes https://github.com/facebook/react-native/pull/4211 Reviewed By: svcscm Differential Revision: D2719953 Pulled By: androidtrunkagent fb-gh-sync-id: 86d18e3847066211a013a50ce2f2a3e2032f5052
This commit is contained in:
parent
699d748bb3
commit
7b62dc22ad
|
@ -57,6 +57,8 @@ class Dimensions {
|
|||
* than caching the value (for example, using inline styles rather than
|
||||
* setting a value in a `StyleSheet`).
|
||||
*
|
||||
* Example: `var {height, width} = Dimensions.get('window');`
|
||||
*
|
||||
* @param {string} dim Name of dimension as defined when calling `set`.
|
||||
* @returns {Object?} Value for the dimension.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue