-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
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
函数式组件作为Page 在支付宝小程序端使用useEffect表现错误 #4068
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
hisanshao
changed the title
函数式组件作为Page 使用useEffect表现错误
函数式组件作为Page 在支付宝小程序端使用useEffect表现错误
Aug 5, 2019
微信和H5端是正常的 |
这个bug还不修复吗?都一个月了 @luckyadam |
同样的问题 |
AEPKILL
added a commit
to AEPKILL/taro
that referenced
this issue
Oct 23, 2019
This was referenced Oct 23, 2019
Chen-jj
pushed a commit
that referenced
this issue
Nov 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
从PageA跳到PageB,再从PageB返回到PageA,此时PageB被卸载,但式PageB里面的useEffect(function () {
return function () {
// 未执行,Page引入的组件内部是可以正常执行的
}
}, [])
复现步骤
[复现问题的步骤]
期望行为
PageB离开的时候执行console.log(222)
报错信息
return的function未被执行
系统信息
Taro CLI 1.3.11 environment info:
System:
OS: macOS 10.14.5
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/v8.10.0/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
npmPackages:
@tarojs/async-await: 1.3.11 => 1.3.11
@tarojs/components: 1.3.11 => 1.3.11
@tarojs/plugin-babel: 1.3.11 => 1.3.11
@tarojs/plugin-csso: 1.3.11 => 1.3.11
@tarojs/plugin-less: 1.3.11 => 1.3.11
@tarojs/plugin-uglifyjs: 1.3.11 => 1.3.11
@tarojs/redux: 1.3.11 => 1.3.11
@tarojs/redux-h5: 1.3.11 => 1.3.11
@tarojs/router: 1.3.11 => 1.3.11
@tarojs/taro: 1.3.11 => 1.3.11
@tarojs/taro-alipay: 1.3.11 => 1.3.11
@tarojs/taro-h5: 1.3.11 => 1.3.11
@tarojs/taro-swan: 1.3.11 => 1.3.11
@tarojs/taro-tt: 1.3.11 => 1.3.11
@tarojs/taro-weapp: 1.3.11 => 1.3.11
@tarojs/webpack-runner: 1.3.11 => 1.3.11
eslint-config-taro: 1.3.11 => 1.3.11
eslint-plugin-taro: 1.3.11 => 1.3.11
nerv-devtools: ^1.4.3 => 1.4.3
nervjs: ^1.4.3 => 1.4.3
stylelint-config-taro-rn: 1.3.11 => 1.3.11
stylelint-taro-rn: 1.3.11 => 1.3.11
补充信息
错误原因:支付宝小程序taro-alipay/src/create-component.js 内的onUnload方法未添加下面这段代码,只在didUnmount内添加了,所以组件有效,Page无效。
The text was updated successfully, but these errors were encountered: