Skip to content

Commit d57f0c2

Browse files
committed
fix: input value controlled issue
1 parent e9ae1f9 commit d57f0c2

File tree

1 file changed

+5
-4
lines changed
  • example/storybook/stories/components/primitives/TextArea

1 file changed

+5
-4
lines changed

example/storybook/stories/components/primitives/TextArea/value.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { TextArea, Box } from 'native-base';
33

44
export const Example = () => {
55
const [textAreaValue, setTextAreaValue] = useState('Value Controlled');
6-
const demoValueControlledTextArea = (e: any) => {
7-
setTextAreaValue(e.currentTarget.value);
8-
};
6+
// const demoValueControlledTextArea = (e: any) => {
7+
// setTextAreaValue(e.currentTarget.value);
8+
// };
99
return (
1010
<Box alignItems="center" w="100%">
1111
<TextArea
1212
value={textAreaValue}
13-
onChange={demoValueControlledTextArea}
13+
onChange={(e: any) => setTextAreaValue(e.currentTarget.value)} // for web
14+
onChangeText={(text: any) => setTextAreaValue(text)} // for android and ios
1415
w="75%"
1516
maxW="300"
1617
/>

0 commit comments

Comments
 (0)