Skip to content

Commit 5635826

Browse files
committed
Deprecate InputAccessoryView
1 parent d9d2502 commit 5635826

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

packages/react-native/Libraries/Components/TextInput/InputAccessoryView.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ import {ViewStyle} from '../../StyleSheet/StyleSheetTypes';
1717
*
1818
* To use this component wrap your custom toolbar with the InputAccessoryView component, and set a nativeID. Then, pass
1919
* that nativeID as the inputAccessoryViewID of whatever TextInput you desire.
20+
*
21+
* InputAccessoryView is deprecated and will be removed in a future release.
22+
* @deprecated
2023
*/
2124
export class InputAccessoryView extends React.Component<InputAccessoryViewProps> {}
2225

26+
/**
27+
* InputAccessoryView is deprecated and will be removed in a future release.
28+
* @deprecated
29+
*/
2330
export interface InputAccessoryViewProps {
2431
backgroundColor?: ColorValue | undefined;
2532

packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import useWindowDimensions from '../../Utilities/useWindowDimensions';
1818
import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent';
1919
import * as React from 'react';
2020

21+
/**
22+
* InputAccessoryView is deprecated and will be removed in a future release.
23+
* @deprecated
24+
*/
2125
/** @build-types emit-as-interface Expo compatibility */
2226
export type InputAccessoryViewProps = Readonly<{
2327
readonly children: React.Node,
@@ -36,8 +40,10 @@ export type InputAccessoryViewProps = Readonly<{
3640
*
3741
* This component can also be used to create sticky text inputs (text inputs which are anchored to the top of the keyboard). To do this, wrap a `TextInput` with `InputAccessoryView` and don't set a `nativeID`.
3842
*
39-
* @see https://reactnative.dev/docs/inputaccessoryview
43+
* InputAccessoryView is deprecated and will be removed in a future release.
44+
*
4045
* @platform ios
46+
* @deprecated
4147
*/
4248
const InputAccessoryView: React.ComponentType<InputAccessoryViewProps> = (
4349
props: InputAccessoryViewProps,

packages/react-native/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ module.exports = {
5555
return require('./Libraries/Image/ImageBackground').default;
5656
},
5757
get InputAccessoryView() {
58+
warnOnce(
59+
'input-accessory-view-deprecated',
60+
'InputAccessoryView is deprecated and will be removed in a future release.',
61+
);
5862
return require('./Libraries/Components/TextInput/InputAccessoryView')
5963
.default;
6064
},

0 commit comments

Comments
 (0)