Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Standalone for NativeComponents] RCTInputAccessoryView #23050

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);