Skip to content

Commit 822efb5

Browse files
committed
replace deprecated nativeID with id
1 parent 6290c69 commit 822efb5

File tree

16 files changed

+32
-32
lines changed

16 files changed

+32
-32
lines changed

src/components/BigNumberPad.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const propTypes = {
1515
longPressHandlerStateChanged: PropTypes.func,
1616

1717
/** Used to locate this view from native classes. */
18-
nativeID: PropTypes.string,
18+
id: PropTypes.string,
1919

2020
...withLocalizePropTypes,
2121
};
2222

2323
const defaultProps = {
2424
longPressHandlerStateChanged: () => {},
25-
nativeID: 'numPadView',
25+
id: 'numPadView',
2626
};
2727

2828
const padNumbers = [
@@ -57,7 +57,7 @@ function BigNumberPad(props) {
5757
return (
5858
<View
5959
style={[styles.flexColumn, styles.w100]}
60-
nativeID={props.nativeID}
60+
id={props.id}
6161
>
6262
{_.map(padNumbers, (row, rowIndex) => (
6363
<View

src/components/Button/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const propTypes = {
112112
isFocused: PropTypes.bool.isRequired,
113113

114114
/** Id to use for this button */
115-
nativeID: PropTypes.string,
115+
id: PropTypes.string,
116116

117117
/** Accessibility label for the component */
118118
accessibilityLabel: PropTypes.string,
@@ -152,7 +152,7 @@ const defaultProps = {
152152
shouldRemoveRightBorderRadius: false,
153153
shouldRemoveLeftBorderRadius: false,
154154
shouldEnableHapticFeedback: false,
155-
nativeID: '',
155+
id: '',
156156
accessibilityLabel: '',
157157
forwardedRef: undefined,
158158
};
@@ -303,7 +303,7 @@ class Button extends Component {
303303
this.props.success && !this.props.isDisabled ? styles.buttonSuccessHovered : undefined,
304304
this.props.danger && !this.props.isDisabled ? styles.buttonDangerHovered : undefined,
305305
]}
306-
nativeID={this.props.nativeID}
306+
id={this.props.id}
307307
accessibilityLabel={this.props.accessibilityLabel}
308308
hoverDimmingValue={1}
309309
>

src/components/EmojiPicker/EmojiPickerButton.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const propTypes = {
1515
isDisabled: PropTypes.bool,
1616

1717
/** Id to use for the emoji picker button */
18-
nativeID: PropTypes.string,
18+
id: PropTypes.string,
1919

2020
/**
2121
* ReportAction for EmojiPicker.
@@ -29,7 +29,7 @@ const propTypes = {
2929

3030
const defaultProps = {
3131
isDisabled: false,
32-
nativeID: '',
32+
id: '',
3333
reportAction: {},
3434
};
3535

@@ -51,7 +51,7 @@ function EmojiPickerButton(props) {
5151
EmojiPickerAction.emojiPickerRef.current.hideEmojiPicker();
5252
}
5353
}}
54-
nativeID={props.nativeID}
54+
id={props.id}
5555
accessibilityLabel={props.translate('reportActionCompose.emoji')}
5656
>
5757
{({hovered, pressed}) => (

src/components/EmojiPicker/EmojiPickerButtonDropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function EmojiPickerButtonDropdown(props) {
4242
style={styles.emojiPickerButtonDropdown}
4343
disabled={props.isDisabled}
4444
onPress={onPress}
45-
nativeID="emojiDropdownButton"
45+
id="emojiDropdownButton"
4646
accessibilityLabel="statusEmoji"
4747
accessibilityRole="text"
4848
>

src/components/Modal/BaseModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class BaseModal extends PureComponent {
167167
<View
168168
style={[styles.defaultModalContainer, modalContainerStyle, modalPaddingStyles, !this.props.isVisible ? styles.pointerEventsNone : {}]}
169169
ref={this.props.forwardedRef}
170-
nativeID="no-drag-area"
170+
id="no-drag-area"
171171
>
172172
{this.props.children}
173173
</View>

src/components/Pressable/GenericPressable/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const WebGenericPressable = forwardRef((props, ref) => (
1010
// change native accessibility props to web accessibility props
1111
tabIndex={!props.accessible || !props.focusable ? -1 : 0}
1212
role={props.accessibilityRole}
13-
id={props.nativeID}
13+
id={props.id}
1414
aria-label={props.accessibilityLabel}
1515
aria-labelledby={props.accessibilityLabelledBy}
1616
aria-valuenow={props.accessibilityValue}
17-
nativeID={props.nativeID || 'no-drag-area'}
17+
id={props.id || 'no-drag-area'}
1818
/>
1919
));
2020

src/components/Pressable/PressableWithFeedback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ const PressableWithFeedbackPropTypes = {
2626
/**
2727
* Used to locate this view from native classes.
2828
*/
29-
nativeID: propTypes.string,
29+
id: propTypes.string,
3030
};
3131

3232
const PressableWithFeedbackDefaultProps = {
3333
...GenericPressablePropTypes.defaultProps,
3434
pressDimmingValue: variables.pressDimValue,
3535
hoverDimmingValue: variables.hoverDimValue,
36-
nativeID: '',
36+
id: '',
3737
wrapperStyle: [],
3838
};
3939

src/components/TextInput/BaseTextInput/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function BaseTextInput(props) {
280280
label={props.label}
281281
labelTranslateY={labelTranslateY}
282282
labelScale={labelScale}
283-
for={props.nativeID}
283+
for={props.id}
284284
/>
285285
</>
286286
) : null}

src/components/TextInput/BaseTextInput/index.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ function BaseTextInput(props) {
281281
label={props.label}
282282
labelTranslateY={labelTranslateY}
283283
labelScale={labelScale}
284-
for={props.nativeID}
284+
for={props.id}
285285
/>
286286
</>
287287
) : null}

src/pages/home/HeaderView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function HeaderView(props) {
138138
return (
139139
<View
140140
style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]}
141-
nativeID="drag-area"
141+
id="drag-area"
142142
>
143143
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}>
144144
{props.isSmallScreenWidth && (

src/pages/home/report/ReportActionItemMessageEdit.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function ReportActionItemMessageEdit(props) {
285285
<PressableWithFeedback
286286
onPress={deleteDraft}
287287
style={styles.chatItemSubmitButton}
288-
nativeID={cancelButtonID}
288+
id={cancelButtonID}
289289
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
290290
accessibilityLabel={translate('common.close')}
291291
// disable dimming
@@ -320,7 +320,7 @@ function ReportActionItemMessageEdit(props) {
320320
// eslint-disable-next-line no-param-reassign
321321
props.forwardedRef.current = el;
322322
}}
323-
nativeID={messageEditInput}
323+
id={messageEditInput}
324324
onChangeText={updateDraft} // Debounced saveDraftComment
325325
onKeyPress={triggerSaveOrCancel}
326326
value={draft}
@@ -357,7 +357,7 @@ function ReportActionItemMessageEdit(props) {
357357
focus(true);
358358
}}
359359
onEmojiSelected={addEmojiToTextBox}
360-
nativeID={emojiButtonID}
360+
id={emojiButtonID}
361361
reportAction={props.action}
362362
/>
363363
</View>
@@ -367,7 +367,7 @@ function ReportActionItemMessageEdit(props) {
367367
<PressableWithFeedback
368368
style={[styles.chatItemSubmitButton, hasExceededMaxCommentLength ? {} : styles.buttonSuccess]}
369369
onPress={publishDraft}
370-
nativeID={saveButtonID}
370+
id={saveButtonID}
371371
disabled={hasExceededMaxCommentLength}
372372
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
373373
accessibilityLabel={translate('common.saveChanges')}

src/pages/home/sidebar/SidebarLinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class SidebarLinks extends React.PureComponent {
165165
<View style={[styles.flex1, styles.h100]}>
166166
<View
167167
style={[styles.flexRow, styles.ph5, styles.pv3, styles.justifyContentBetween, styles.alignItemsCenter]}
168-
nativeID="drag-area"
168+
id="drag-area"
169169
>
170170
<Header
171171
title={

src/pages/iou/steps/MoneyRequestAmountForm.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
7676
* Event occurs when a user presses a mouse button over an DOM element.
7777
*
7878
* @param {Event} event
79-
* @param {Array<string>} nativeIds
79+
* @param {Array<string>} ids
8080
*/
81-
const onMouseDown = (event, nativeIds) => {
81+
const onMouseDown = (event, ids) => {
8282
const relatedTargetId = lodashGet(event, 'nativeEvent.target.id');
83-
if (!_.contains(nativeIds, relatedTargetId)) {
83+
if (!_.contains(ids, relatedTargetId)) {
8484
return;
8585
}
8686
event.preventDefault();
@@ -200,7 +200,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
200200
return (
201201
<>
202202
<View
203-
nativeID={AMOUNT_VIEW_ID}
203+
id={AMOUNT_VIEW_ID}
204204
onMouseDown={(event) => onMouseDown(event, [AMOUNT_VIEW_ID])}
205205
style={[styles.flex1, styles.flexRow, styles.w100, styles.alignItemsCenter, styles.justifyContentCenter]}
206206
>
@@ -231,11 +231,11 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
231231
<View
232232
onMouseDown={(event) => onMouseDown(event, [NUM_PAD_CONTAINER_VIEW_ID, NUM_PAD_VIEW_ID])}
233233
style={[styles.w100, styles.justifyContentEnd, styles.pageWrapper]}
234-
nativeID={NUM_PAD_CONTAINER_VIEW_ID}
234+
id={NUM_PAD_CONTAINER_VIEW_ID}
235235
>
236236
{DeviceCapabilities.canUseTouchScreen() ? (
237237
<BigNumberPad
238-
nativeID={NUM_PAD_VIEW_ID}
238+
id={NUM_PAD_VIEW_ID}
239239
numberPressed={updateAmountNumberPad}
240240
longPressHandlerStateChanged={updateLongPressHandlerState}
241241
/>

src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthForm/BaseTwoFactorAuthForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function BaseTwoFactorAuthForm(props) {
8888
autoComplete={props.autoComplete}
8989
textContentType="oneTimeCode"
9090
label={props.translate('common.twoFactorCode')}
91-
nativeID="twoFactorAuthCode"
91+
id="twoFactorAuthCode"
9292
name="twoFactorAuthCode"
9393
value={twoFactorAuthCode}
9494
onChangeText={onTextInput}

src/pages/signin/LoginForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function LoginForm(props) {
194194
value={login}
195195
autoCompleteType="username"
196196
textContentType="username"
197-
nativeID="username"
197+
id="username"
198198
name="username"
199199
onChangeText={onTextInput}
200200
onSubmitEditing={validateAndSubmitForm}

src/stories/Composer.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Default(args) {
4242
<View style={[styles.flexRow, styles.mv5, styles.flexWrap, styles.w100]}>
4343
<View
4444
style={[styles.border, styles.noLeftBorderRadius, styles.noRightBorderRadius, styles.p5, styles.flex1]}
45-
nativeID={CONST.REPORT.DROP_NATIVE_ID}
45+
id={CONST.REPORT.DROP_NATIVE_ID}
4646
>
4747
<Text style={[styles.mb2, styles.textLabelSupporting]}>Entered Comment (Drop Enabled)</Text>
4848
<Text>{comment}</Text>

0 commit comments

Comments
 (0)