amazing design
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, forwardRef } from 'react';
|
||||
import { View, TextInput, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import { COLORS } from '../constants/colors';
|
||||
|
||||
const Input = ({
|
||||
const Input = forwardRef(({
|
||||
label,
|
||||
value,
|
||||
onChangeText,
|
||||
@@ -17,7 +17,7 @@ const Input = ({
|
||||
returnKeyType = 'done',
|
||||
onSubmitEditing,
|
||||
...props
|
||||
}) => {
|
||||
}, ref) => {
|
||||
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
@@ -40,6 +40,7 @@ const Input = ({
|
||||
</View>
|
||||
)}
|
||||
<TextInput
|
||||
ref={ref}
|
||||
style={[styles.input, leftIcon && styles.inputWithLeftIcon]}
|
||||
value={value}
|
||||
onChangeText={onChangeText}
|
||||
@@ -70,7 +71,7 @@ const Input = ({
|
||||
{error && <Text style={styles.errorText}>{error}</Text>}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
|
||||
Reference in New Issue
Block a user