Commit Graph

19 Commits

Author SHA1 Message Date
Sebastian Markbage 6f43d1f2cb Codemod import React from 'react-native'
Reviewed By: spicyj

Differential Revision: D3223162

fb-gh-sync-id: 0b1af846afe17cdf8b2c2ca7f31f1197cde752c0
fbshipit-source-id: 0b1af846afe17cdf8b2c2ca7f31f1197cde752c0
2016-04-25 22:08:46 -07:00
Aaron Connolly 67b138e77c Added a small note about an issue I ran into vending a simple `UIView?
Summary:?` instance to React Native. The layout system suppressed the values for `frame` and `backgroundColor` on my simple view and it wasn't clear why. After some debugging and hacking it became apparent that React Native needed to adjust those properties during layout. The workaround I found was to wrap my custom `UIView` in another `UIView` instance.

**Motivation**

When attempting to bridge a simple 100x100 red background `UIView` to ReactNative I could not get the view to show up as a `RCTView`. The view was there, but it was not 100x100 and it didn't have a red background. After a couple hours of poking around and debugging the call stacks on `setBackgroundColor` and `setFrame` it became apparent that React Native calls those messages on your `UIView` and sends new values. This is likely because of the layout system React Native uses.

I was encouraged to provide a small comment in the documentation if I thought others might find it useful. This PR is an attempt to provide a note in the documentation
Closes https://github.com/facebook/react-native/pull/6786

Differential Revision: D3133093

fb-gh-sync-id: 77d895f2f8e09978d283ee9e3193ee68cc5a7cb8
fbshipit-source-id: 77d895f2f8e09978d283ee9e3193ee68cc5a7cb8
2016-04-04 04:36:19 -07:00
Mateusz Zatorski 3ae99d0fea replace require with es6 import in docs
Reviewed By: svcscm

Differential Revision: D2936839

fb-gh-sync-id: 7a921709a37de5e9aadf324d5438d51851326348
shipit-source-id: 7a921709a37de5e9aadf324d5438d51851326348
2016-02-14 15:03:34 -08:00
Nick Lockwood 9d0242fdc3 Replace direct access of NativeModules.UIManager with require('UIManager')
Summary:
public
Due to the cross-platform polyfills we have added (and will add in future) to `UIManager.js`, accessing UIManager directly via NativeModules instead of importing the wrapper is discouraged.

This diff fixes a few places where we were doing this inside our own modules.

Note: As a general policy, we should avoid accessing modules via NativeModules anyway. Using wrapper classes allows us to provide static declarations for all the native methods and properties, which can be checked at build time by flow. If we access the modules directly, those interfaces are only known at runtime.

Reviewed By: vjeux

Differential Revision: D2881300

fb-gh-sync-id: 6737358ea8ea6d722cc1941a4b9fa0123a87fc29
2016-01-30 07:36:34 -08:00
sunnylqm 72a08c11c6 remove broken link 2015-12-31 11:41:49 +08:00
Nikita Gusakov e55b373a61 Split iOS and Android docs into different categories 2015-09-18 20:54:05 +03:00
Spencer Ahrens bb79d034d2 Add comments about `nativeOnly` props 2015-09-15 10:37:48 -07:00
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00
Martin Konicek 01911e5e06 [docs] Make it clear which Guides are platform-specific
This is in preparation for open sourcing React Native for Android.
Also add hyphens to URLs for consistency. This can break people's
browser bookmarks but it's better to be consistent and we can
redirect to docs: https://github.com/facebook/react-native/issues/2137

Test plan: Ran the website locally using `cd website; npm start`
and checked all pages render correctly.
http://i.imgur.com/RrPNgRr.png

Will update "Getting Started", "Tutorial", "Debugging" and
"Testing" separately.
2015-07-27 18:17:54 +01:00
Amjad Masad 82ca3364c6 Don't encourage the use of internal modules 2015-06-30 13:12:47 -07:00
Brent Vatne e2c6060226 [Docs] Add DirectManipluation guide, which explains setNativeProps 2015-06-17 21:43:39 -07:00
Jehan c4457f8e6f Update NativeComponentsIOS.md 2015-06-03 00:34:25 -07:00
Brent Vatne ffcdf21004 [Docs] Clarify the variables provided to RCT_CUSTOM_VIEW_PROPERTY body 2015-05-24 09:35:59 -07:00
James Ide 69db752067 Move requireNativeComponent call below the complete MapView definition
requireNativeComponent should be called after the wrapper component is fully defined, including its static properties.
2015-05-13 21:05:50 -07:00
Zhao Han 85a6734387 Update link in Native UI Components (iOS) guide
Update the event mapping link: update line number
2015-05-13 10:08:38 -05:00
James Ide 0e3d627ff0 Fix some typos in NativeComponentsIOS.md
Fixed some syntax errors and tidied up the sample code.
2015-04-30 00:39:37 -07:00
Spencer Ahrens f89bcacd86 Add missing 'and' in docs. 2015-04-29 15:42:30 -07:00
Spencer Ahrens 8efe148f07 Fix bullet spacing for website.
GitHub markdown rendered it fine, but it was all mashed inline on the website without the extra break.
2015-04-29 15:41:17 -07:00
Spencer Ahrens c5d367ad39 Add Native Components guide. 2015-04-21 16:22:32 -07:00