We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序
https://github.com/conan51551/taro-demo 小程序基础库: 2.16.1 使用框架: React
1.在使用了hook的function component中,使用组件InputNumber组件 2.InputNumber中使用了Taro的Input组件,在onBlur的时候,如果输入大于5的数字,会调用父组件change充值Input的value为5 3.只有第一次成功重置了,之后虽然每次都setNum了,但是页面并没有刷新
const [Num, setNum] = useState(1); const change = (_num) => { setNum(() => _num); }; return ( <View> <InputNumber num={Num} change={change} /> </View> );
当输入大于5的数字,数字每次都被改成5
在class componet中可以,但是在hook的function component中,只有第一次被修改成了5
Taro CLI 3.2.5 environment info: System: OS: macOS 11.2.3 Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm npmPackages: @tarojs/components: 3.1.1 => 3.1.1 @tarojs/mini-runner: 3.1.1 => 3.1.1 @tarojs/react: 3.1.1 => 3.1.1 @tarojs/runtime: 3.1.1 => 3.1.1 @tarojs/taro: 3.1.1 => 3.1.1 @tarojs/webpack-runner: 3.1.1 => 3.1.1 babel-preset-taro: 3.1.1 => 3.1.1 eslint-config-taro: 3.1.1 => 3.1.1 react: ^17.0.0 => 17.0.2
The text was updated successfully, but these errors were encountered:
@conan51551 Demo 链接挂了
Sorry, something went wrong.
现在好了
我也遇见了 还有input输入的值重置时绑定了state设置对应的state也不能更新到最新的state 求解决!
No branches or pull requests
相关平台
微信小程序
复现仓库
https://github.com/conan51551/taro-demo
小程序基础库: 2.16.1
使用框架: React
复现步骤
1.在使用了hook的function component中,使用组件InputNumber组件
2.InputNumber中使用了Taro的Input组件,在onBlur的时候,如果输入大于5的数字,会调用父组件change充值Input的value为5
3.只有第一次成功重置了,之后虽然每次都setNum了,但是页面并没有刷新
期望结果
当输入大于5的数字,数字每次都被改成5
实际结果
在class componet中可以,但是在hook的function component中,只有第一次被修改成了5
环境信息
The text was updated successfully, but these errors were encountered: