Commit Graph

9 Commits

Author SHA1 Message Date
Sebastian Markbage a80dd9a92a Fix up this pattern var React = require('react-native');
Summary:First I searched for special cases that destructor PropTypes:

```
(?s)React\s*=\s*require\('react\-native'\).*(Children|PropTypes)[^\{\}]*\}\s*=\s*React;
```

I split them up manually.

Then I replaced the React = require('react-native') + destructuring pattern...

```
(?s)(const|var)\s+React\s*=\s*require\('react\-native'\)(.*[^\{\}]*\}\s*=\s*)React;
```

...with...

```
$1 React = require('react');
$1 ReactNative = require('react-native')$2ReactNative;
```

I used lint to figure out if I left some unnecessary imports.

Finally I grepped for just

```
React\s*=\s*require\('react\-native'\)
```

to catch any remaining patterns.

Also, `} = React.NativeModules` -> `} = ReactNative.NativeModules`.

Reviewed By: spicyj

Differential Revision: D3158991

fb-gh-sync-id: f97e8e921e193d6ea1a49d8d1bf3f09be7bed5c3
fbshipit-source-id: f97e8e921e193d6ea1a49d8d1bf3f09be7bed5c3
2016-04-08 20:37:22 -07:00
Nick 2a03182b1c CHORE - Remove Trailing Spaces
Summary:Remove Trailing Spaces.

Why:
Sometimes there are conflicts with trailing spaces
Saves space
Those whose tools automatically delete them will have their pr watered down with trailing space removal
Closes https://github.com/facebook/react-native/pull/6787

Differential Revision: D3144704

fb-gh-sync-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
fbshipit-source-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
2016-04-06 09:21:53 -07:00
Kyle Corbitt 2d921eeb70 Resolve react flow definitions
Summary:Currently, we're not taking advantage of Flow's built-in type definitions for the React library in all cases because Flow's definition uses `declare module react` and this file uses `import('React')`, which Flow thinks is a different library. After this change, the following starts working which didn't before:

```js
import { Component } from 'react-native';

class MyText extends Component<void, {text: string}, void> {
  render() { return <Text>{this.props.text}</Text> }
}

// Correctly throws a Flow error for the missing "text" prop
const renderedText = <MyText />;
```
Closes https://github.com/facebook/react-native/pull/5489

Differential Revision: D2856176

fb-gh-sync-id: 473ca188ad7d990c3e765526c4b33caf49ad9ffd
shipit-source-id: 473ca188ad7d990c3e765526c4b33caf49ad9ffd
2016-02-25 02:45:34 -08:00
Nick Lockwood a322ab61fb Fix ImageEditor example
Summary:
public

A fix added to make the ImageEditor example usable on Android inadvertantly broke the cropping logic on iOS, so that zoomed images were cropped incorrectly.

This diff fixes that, and also sets the min/max zoom scale correctly based on the image scale, instead of using a hard-coded value.

Reviewed By: bestander

Differential Revision: D2874576

fb-gh-sync-id: 02c62940c24f4d4266655de6ddbf4fe3bc9c13ce
2016-01-28 09:43:34 -08:00
August Flanagan 0f7477f9f9 add flag to enable momentum scrolling on iOS
Summary:
Expose a `decelerationNormalEnabled` flag on WebView, which, when enabled, will WebView's ScrollView's `decelerationRate` to `UIScrollViewDecelerationRateNormal`. This gives the WebView the same "momentum" style scrolling as other iOS views.

This was discussed with ide in #5447. Please let me know if there's anything I'm missing, or anything else you'd like to see in this pull request.
Closes https://github.com/facebook/react-native/pull/5527

Reviewed By: svcscm

Differential Revision: D2870312

Pulled By: nicklockwood

fb-gh-sync-id: 7dbfd06a349e3365a5df40c3bacf25a4fdb306cf
2016-01-28 05:36:33 -08:00
Konstantin Raev 1d819e9503 Open sourced <ImageEditor>, <ImageStore> for Android
Reviewed By: mkonicek

Differential Revision: D2869751

fb-gh-sync-id: 862c266601dd83ca3bf9c9bcbf107f7b17b8bdfd
2016-01-27 10:50:54 -08:00
Nick Lockwood 83c2e0303b Added JS wrappers for ImageStore and ImageEditor
Summary:
public
Added JS wrappers for ImageStore(Manager) and ImageEditor(Manager) so they can be required in the normal way instead of accessed directly via NativeModules.

Reviewed By: dmmiller

Differential Revision: D2773822

fb-gh-sync-id: 6eeafd3f80a87b1b91a04a2aebad6e2fd31b0e98
2015-12-23 10:08:07 -08:00
Nick Lockwood 60db876f66 Wrapped UIManager native module for better abstraction
Summary: public

RCTUIManager is a public module with several useful methods, however, unlike most such modules, it does not have a JS wrapper that would allow it to be required directly.

Besides making it more cumbersome to use, this also makes it impossible to modify the UIManager API, or smooth over differences between platforms in the JS layer without breaking all of the call sites.

This diff adds a simple JS wrapper file for the UIManager module to make it easier to work with.

Reviewed By: tadeuzagallo

Differential Revision: D2700348

fb-gh-sync-id: dd9030eface100b1baf756da11bae355dc0f266f
2015-11-27 07:00:32 -08:00
Philipp von Weitershausen 37636fc59a [React Native] open source ImageEditingManager native module 2015-07-29 15:57:48 -08:00