We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56bc60e commit 4c2351fCopy full SHA for 4c2351f
javascript/frameworks/ui5/test/models/source-react/functionalcomponentsetstate.tsx
@@ -0,0 +1,16 @@
1
+import React, { useState } from 'react';
2
+
3
+function MyFunctionalComponent({ props }) {
4
+ const [count, setState] = useState({ count: 0 });
5
6
+ const handleClick = event => {
7
+ setState({ count: event.target.value + 1 }); // Directly update the state
8
+ console.log('Current input value:', count);
9
+ };
10
11
+ return (
12
+ <div>
13
+ <input value={count.count} onChange={handleClick}></input>
14
+ </div>
15
+ );
16
+}
0 commit comments