import React, { useState } from 'react';
import { View, TextInput, Button } from 'react-native';
const MyComponent = () => {
const [text, setText] = useState('');
const handlePress = () => {
console.log(text);
};
return (
value={text}
onChangeText={setText}
/>
);
};
ERROR ReferenceError: Property 'setText' doesn't exist
This error is located at:
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes
ERROR ReferenceError: Property 'setText' doesn't exist
This error is located at:
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes
Выдаёт эту ошибку.