react-native-macos/Libraries/Image
Eli White 69c38e5a63 Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent
Summary:
In React Native there are three types of "Native" components.

```
createReactClass with NativeMethodsMixin
```
```
class MyComponent extends ReactNative.NativeComponent
```
```
requireNativeComponent('RCTView')
```

The implementation for how to handle all three of these exists in the React Native Renderer. Refs attached to components created via these methods provide a set of functions such as
```
.measure
.measureInWindow
.measureLayout
.setNativeProps
```

These methods have been used for our core components in the repo to provide a consistent API. Many of the APIs in React Native require a `reactTag` to a host component. This is acquired by calling `findNodeHandle` with any component. `findNodeHandle` works with the first two approaches.

For a lot of our new Fabric APIs, we will require passing a ref to a HostComponent directly instead of relying on `findNodeHandle` to tunnel through the component tree as that behavior isn't safe with React concurrent mode.

The goal of this change is to enable us to differentiate between components created with `requireNativeComponent` and the other types. This will be needed to be able to safely type the new APIs.

For existing components that should support being a host component but need to use some JS behavior in a wrapper, they should use `forwardRef`. The majority of React Native's core components were migrated to use `forwardRef` last year. Components that can't use forwardRef will need to have a method like `getNativeRef()` to get access to the underlying host component ref.

Note, we will need follow up changes as well as changes to the React Renderer in the React repo to fully utilize this new type.

Changelog:
[Internal] Flow type to differentiate between HostComponent and NativeMethodsMixin and NativeComponent

Reviewed By: jbrown215

Differential Revision: D17551089

fbshipit-source-id: 7a30b4bb4323156c0b2465ca41fcd05f4315becf
2019-09-25 10:12:38 -07:00
..
__tests__ Explicitly separate mocked native modules from mocked JS modules (#24809) 2019-05-31 03:19:49 -07:00
AssetRegistry.js Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
AssetSourceResolver.js Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) (#24749) 2019-05-08 08:48:59 -07:00
Image.android.js Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent 2019-09-25 10:12:38 -07:00
Image.ios.js Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent 2019-09-25 10:12:38 -07:00
ImageBackground.js Delete ensureComponentIsNative.js 2019-08-14 11:46:58 -07:00
ImagePickerIOS.js xplat/js/react-native-github 2019-08-09 10:11:15 -07:00
ImageProps.js Migrate "Libraries" from Haste to standard path-based requires (sans vendor & renderers) (#24749) 2019-05-08 08:48:59 -07:00
ImageResizeMode.js RN: Replace `ImageResizeMode` w/ Flow Type 2018-09-28 01:07:30 -07:00
ImageSource.js @allow-large-files Deploy Flow v0.99.0 to xplat/js 2019-05-29 18:11:43 -07:00
ImageViewNativeComponent.js Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent 2019-09-25 10:12:38 -07:00
NativeImageLoader.js Final fixes and seal xplat/js/react-native-github 2019-08-23 08:45:11 -07:00
NativeImagePickerIOS.js xplat/js/react-native-github 2019-08-09 10:11:15 -07:00
RCTAnimatedImage.h Animated image improvements (#24822) 2019-06-24 03:45:23 -07:00
RCTAnimatedImage.m Fixes animated gifs incorrectly looping (#25612) 2019-08-28 08:15:11 -07:00
RCTGIFImageDecoder.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTGIFImageDecoder.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTImageBlurUtils.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageBlurUtils.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTImageCache.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTImageCache.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTImageDataDecoder.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTImageLoaderProtocol.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTImageShadowView.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageShadowView.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTImageURLLoader.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTImageUtils.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageUtils.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTImageView.h Add border properties to `RCTImageView` 2019-04-16 11:04:20 -07:00
RCTImageView.m Ensure ImageLoader is lazily loaded as necessary 2019-08-21 16:11:32 -07:00
RCTImageViewManager.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageViewManager.m Ensure ImageLoader is lazily loaded as necessary 2019-08-21 16:11:32 -07:00
RCTLocalAssetImageLoader.h Migrate RCTImage NativeModules to CoreModules 2019-08-14 13:39:30 -07:00
RCTLocalAssetImageLoader.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTResizeMode.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTResizeMode.m CocoaPods frameworks compatibility: Step 2 (#25619) 2019-07-24 23:27:09 -07:00
RCTUIImageViewAnimated.h Back out "[RN] Remove RCTUIImageViewAnimated WeakProxy gating" 2019-09-07 19:04:45 -07:00
RCTUIImageViewAnimated.m iOS Image: skip CADisplayLink optimization only when weakProxy is enabled 2019-09-23 15:25:30 -07:00
React-RCTImage.podspec Remove 's.static_framework = true' requirement for podspec (#25816) 2019-07-25 11:46:43 -07:00
RelativeImageStub.js xplat/js/react-native-github 2019-08-09 10:11:15 -07:00
TextInlineImageNativeComponent.js Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent 2019-09-25 10:12:38 -07:00
assetPathUtils.js xplat/js/react-native-github 2019-08-09 10:11:15 -07:00
nativeImageSource.js RN: Improve `nativeImageSource` Return Type 2019-09-09 14:58:38 -07:00
resolveAssetSource.js Add spec for SourceCode (#24901) 2019-05-22 03:27:54 -07:00