I cannot update state in useState coding in React Native. component is styled TextInput.What I do wrong that state don't see text input from SearchField ?
export const TabOneScreen: FC<IProps> = ({ navigation }) => { const [userName, setUserName] = useState("jan"); useEffect(() => { fetch(`https://api.github.com/users/${userName}`) .then((response) => response.json()) .then((json) => console.log(json)); }, [userName]); const handleUserName = (value: string) => { setUserName(value); }; return (<StyledContainer><SearchField onChangeText={(value: string) => handleUserName(value)} /><Text>{userName}</Text><DetailsField backgroundColor={colors.whiteColor} /><Button color={colors.buttonBackground} title="Show more" onPress={() => { navigation.navigate("DetailsScreen"); }} /></StyledContainer> );};