Skip to content

Commit

Permalink
RCTInputAccessoryView (facebook#23050)
Browse files Browse the repository at this point in the history
Summary:
Created Standalone JS file for RCTInputAccessoryView native component facebook#22990

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

[iOS] [Changed] - Created Standalone JS file for RCTInputAccessoryView native component
Pull Request resolved: facebook#23050

Differential Revision: D13735644

Pulled By: TheSavior

fbshipit-source-id: 64b091957b38cb11d804582f185d5cb0c6754af3
  • Loading branch information
doniyor2109 authored and facebook-github-bot committed Jan 18, 2019
1 parent 5e6c124 commit 69757e4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Libraries/Components/TextInput/InputAccessoryView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 69757e4

Please sign in to comment.