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
React Native
https://github.com/a709691139/taro4.0.git
使用框架: React
随便写个onClick useState, 然后点击几次view,就发现onClick事件一直是旧的
import { useState } from 'react'; import { View } from '@tarojs/components'; const Index = () => { const [staticed, setStaticed] = useState(false); return ( <View> formStaticed: {JSON.stringify(staticed)} <View onClick={() => { console.log('old value ', staticed); setStaticed(!staticed); }}> 切换 </View> </View> ); }; export default Index;
console.log('old value ', staticed); 这里的输出永远是false
应该是true或false轮着来
👽 Taro v4.0.0-beta.8 Taro CLI 4.0.0-beta.8 environment info: System: OS: Windows 11 10.0.22621 Binaries: Node: 18.16.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD npmPackages: @tarojs/cli: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/components: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/components-rn: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/helper: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-framework-react: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-alipay: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-h5: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-jd: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-qq: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-swan: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-tt: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/plugin-platform-weapp: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/react: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/rn-runner: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/rn-supporter: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/runtime: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/runtime-rn: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/shared: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/taro: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/taro-loader: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/taro-rn: 4.0.0-beta.8 => 4.0.0-beta.8 @tarojs/webpack5-runner: 4.0.0-beta.8 => 4.0.0-beta.8 babel-preset-taro: 4.0.0-beta.8 => 4.0.0-beta.8 eslint-config-taro: 4.0.0-beta.8 => 4.0.0-beta.8 expo: ~50.0.2 => 50.0.4 react: ^18.2.0 => 18.2.0 react-native: ^0.73.1 => 0.73.3
The text was updated successfully, but these errors were encountered:
这里是运行结果
Sorry, something went wrong.
找到解决方法了,因为PanResponder拿到的值都是旧的, props要改用ref来获取
#15212 关联pull request
heiazu
Successfully merging a pull request may close this issue.
相关平台
React Native
复现仓库
https://github.com/a709691139/taro4.0.git
使用框架: React
复现步骤
随便写个onClick useState, 然后点击几次view,就发现onClick事件一直是旧的
期望结果
console.log('old value ', staticed);
这里的输出永远是false
实际结果
应该是true或false轮着来
环境信息
The text was updated successfully, but these errors were encountered: