react-native/Libraries/Utilities
Satyajit Sahoo 803cb61346 Show better error message when accessing React APIs on React Native
Summary:
**Motivation:**

Lots of examples on the web still have the old way to import React APIs from React Native. Also when someone upgrades to latest version of React Native without reading the release notes can get confused. This PR adds getters for  `createClass` and `Component` and throws an error with a better error message when they are accessed.

![screenshot_20160614-125622](https://cloud.githubusercontent.com/assets/1174278/16034600/47c70222-3230-11e6-9fe4-1a3493708829.png)

**Test plan:**

Trying to use `ReactNative.createClass` or `ReactNative.Component` will throw an error with this error message.

There's currently a bug in `symbolicateStackTrace` which actually crashes the app after showing the error due to the `stack` being null when updating the stack trace. But that's a separate issue which should be fixed separately. For now, to prevent the crash, we need to add the following before the return statement here - https://github.com/facebook/react-native/blob/master/Libraries/JavaScriptAppEn
Closes https://github.com/facebook/react-native/pull/8099

Differential Revision: D3430468

Pulled By: javache

fbshipit-source-id: c098e51e1f2c276d87eca6da3bd91a457d7840c5
2016-06-14 06:28:26 -07:00
..
__mocks__ Update Jest APIs on fbsource 2016-04-27 19:16:32 -07:00
__tests__ Open source jest tests for open source components 2016-06-13 08:28:50 -07:00
differ Update Jest APIs on fbsource 2016-04-27 19:16:32 -07:00
Alert.js Simplified AlertIOS 2016-01-21 10:57:26 -08:00
AlertIOS.js CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
BackAndroid.android.js Backed out changeset 13a4ea1d64ce 2016-03-29 03:42:18 -07:00
BackAndroid.ios.js RN: Remove BackAndroid Warning 2015-11-12 13:24:27 -08:00
CPUProfiler.js Add NativeProfiling module that uses RN nativeProfiler or console.profile 2015-11-27 04:44:25 -08:00
Dimensions.js Update Dimensions when device orientation changes 2016-03-15 05:49:25 -07:00
ErrorUtils.js Remove the need for allowTopLevelThis in transform-es2015-modules-commonjs 2016-04-29 16:15:34 -07:00
HMRClient.js Remove dead SourceMap code 2016-06-01 13:59:16 -07:00
HMRLoadingView.android.js Show a Toast for HMR 2016-02-27 15:58:35 -08:00
HMRLoadingView.ios.js Show a Toast for HMR 2016-02-27 15:58:35 -08:00
HeapCapture.js Capture heap from the dev menu 2016-04-29 07:35:22 -07:00
MatrixMath.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
MessageQueue.js Remove name property from native modules 2016-05-09 05:46:23 -07:00
PerformanceLogger.js Use monotonic clock instead of currentTimeMillis 2016-03-30 12:47:20 -07:00
PixelRatio.js PixelRatio.pixel() 2016-01-15 05:15:31 -08:00
Platform.android.js Reverted commit D3369528 2016-06-03 05:43:26 -07:00
Platform.ios.js Reverted commit D3369528 2016-06-03 05:43:26 -07:00
RCTLog.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
RCTRenderingPerf.js Update to React 15.1.0-alpha.1 2016-05-10 15:58:24 -07:00
Systrace.js Allow additional information to be passed to systrace events 2016-06-13 04:28:38 -07:00
UIManager.js explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
buildStyleInterpolator.js Deprecate transformMatrix and decomposedMatrix 2016-04-29 14:19:25 -07:00
clamp.js Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
createStrictShapeTypeChecker.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
deepFreezeAndThrowOnMutationInDev.js Ensure recursion is terminated on objects with cyclical references 2016-02-12 14:56:00 -08:00
deprecatedCallback.js explicit type args in react-native-github 2016-05-24 18:28:26 -07:00
deprecatedPropType.js Add a deprecatedPropType module to show deprecation warnings 2016-01-29 02:05:38 -08:00
dismissKeyboard.js [ReactNative] Sync [react_native] Fix keyboard behavior for android 2015-08-14 02:58:37 -08:00
groupByEveryN.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
infoLog.js Move infoLog to OSS 2016-05-17 12:43:40 -07:00
logError.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
mapWithSeparator.js Optimize and flowify mapWithSeparator 2016-05-26 12:28:55 -07:00
mergeFast.js Fix typo 2015-08-06 20:22:24 -08:00
mergeIntoFast.js Bugfix - Typos 2015-12-15 09:09:32 -08:00
stringifySafe.js [ReactNative] improve console logging a little bit 2015-05-04 18:57:03 -08:00
throwOnWrongReactAPI.js Show better error message when accessing React APIs on React Native 2016-06-14 06:28:26 -07:00
truncate.js Fix truncate tests 2016-06-13 10:13:36 -07:00
utf8.js Add support for missing XHR response types 2016-04-11 05:54:28 -07:00