From 26b3b10f86861beb497a418a3fb3dd0e9fa985d4 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Tue, 1 Aug 2023 09:45:56 +0200 Subject: [PATCH] Use destructuring --- src/components/TextInput/TextInputLabel/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/TextInput/TextInputLabel/index.js b/src/components/TextInput/TextInputLabel/index.js index b39e6126e4e0..4267099a56ea 100644 --- a/src/components/TextInput/TextInputLabel/index.js +++ b/src/components/TextInput/TextInputLabel/index.js @@ -4,14 +4,14 @@ import styles from '../../../styles/styles'; import {propTypes, defaultProps} from './TextInputLabelPropTypes'; import CONST from '../../../CONST'; -function TextInputLabel(props) { +function TextInputLabel({for: inputId, label, labelTranslateY, labelScale}) { const labelRef = useRef(null); useEffect(() => { - if (!props.for || !labelRef.current) { + if (!inputId || !labelRef.current) { return; } - labelRef.current.setAttribute('for', props.for); + labelRef.current.setAttribute('for', inputId); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -20,9 +20,9 @@ function TextInputLabel(props) { ref={labelRef} pointerEvents="none" accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} - style={[styles.textInputLabel, styles.textInputLabelDesktop, styles.textInputLabelTransformation(props.labelTranslateY, 0, props.labelScale)]} + style={[styles.textInputLabel, styles.textInputLabelDesktop, styles.textInputLabelTransformation(labelTranslateY, 0, labelScale)]} > - {props.label} + {label} ); }