Skip to content

Commit

Permalink
Use destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Aug 1, 2023
1 parent 4425416 commit 26b3b10
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/TextInput/TextInputLabel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}, []);

Expand All @@ -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}
</Animated.Text>
);
}
Expand Down

0 comments on commit 26b3b10

Please sign in to comment.