You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns.
此回复基于 ChatGPT 自动生成,可以尝试下方案,官方人员会在一定时间后继续继续处理。
🧐 问题描述 | Problem description
[在input中的onchange事件中使用useModel,每次输入都会导致光标跳到最后]
💻 示例代码 | Sample code
model/demo.ts
import { useCallback, useState } from 'react';
export default () => {
const [value, setValue] = useState("");
const propUpdate = useCallback((val) => {
setValue(val);}, []);
return { value, propUpdate }
}
/View.tsx
const { value, propUpdate } = useModel('demo');
<Input size="small" value={value} onChange={(e) => propUpdate("test")}>
The text was updated successfully, but these errors were encountered: