RCTInputAccessoryView (#23050)

Summary:
Created Standalone JS file for RCTInputAccessoryView native component #22990

Changelog:
----------

[iOS] [Changed] - Created Standalone JS file for RCTInputAccessoryView native component
Pull Request resolved: https://github.com/facebook/react-native/pull/23050

Differential Revision: D13735644

Pulled By: TheSavior

fbshipit-source-id: 64b091957b38cb11d804582f185d5cb0c6754af3
This commit is contained in:
doniyor2109
2019-01-18 11:23:00 -08:00
committed by Facebook Github Bot
parent 6a3d9c06ce
commit 3144299b5a
2 changed files with 37 additions and 5 deletions

View File

@@ -14,9 +14,7 @@ const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');
const requireNativeComponent = require('requireNativeComponent');
const RCTInputAccessoryView = requireNativeComponent('RCTInputAccessoryView');
const RCTInputAccessoryViewNativeComponent = require('RCTInputAccessoryViewNativeComponent');
import type {ViewStyleProp} from 'StyleSheet';
@@ -100,12 +98,12 @@ class InputAccessoryView extends React.Component<Props> {
}
return (
<RCTInputAccessoryView
<RCTInputAccessoryViewNativeComponent
style={[this.props.style, styles.container]}
nativeID={this.props.nativeID}
backgroundColor={this.props.backgroundColor}>
{this.props.children}
</RCTInputAccessoryView>
</RCTInputAccessoryViewNativeComponent>
);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
import type {NativeComponent} from 'ReactNative';
import type {ColorValue} from 'StyleSheetTypes';
import type {ViewStyleProp} from 'StyleSheet';
const React = require('React');
const requireNativeComponent = require('requireNativeComponent');
type NativeProps = $ReadOnly<{|
+children: React.Node,
/**
* An ID which is used to associate this `InputAccessoryView` to
* specified TextInput(s).
*/
nativeID?: ?string,
style?: ?ViewStyleProp,
backgroundColor?: ?ColorValue,
|}>;
type NativeInputAccessoryView = Class<NativeComponent<NativeProps>>;
module.exports = ((requireNativeComponent(
'RCTInputAccessoryView',
): any): NativeInputAccessoryView);