Skip to content
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

useShareAppMessage 使用后会自动刷新页面,期望不刷新 #7621

Closed
jiangyuzhen opened this issue Sep 15, 2020 · 2 comments
Closed
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x

Comments

@jiangyuzhen
Copy link

相关平台

微信小程序

小程序基础库: 2.11.0
使用框架: React

复现步骤

useShareAppMessage(() => {
return {
title: xxx,
path: url,
imageUrl: Image,
};
});

期望结果

期望不要刷新页面

实际结果

使用useShareAppMessage这个hock后在用户点击取消,会重新刷新当前页面

环境信息


  Taro CLI 3.0.7 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.3 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.14.6 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: ^2.0.7 => 2.1.3
      @tarojs/components: ^2.0.7 => 2.1.3
      @tarojs/mini-runner: ^2.0.7 => 2.1.3
      @tarojs/taro: ^2.0.7 => 2.1.3
      @tarojs/webpack-runner: ^2.0.7 => 2.1.3
      nerv-devtools: ^1.5.6 => 1.5.6
      nervjs: ^1.5.6 => 1.5.6
      taro-ui: ^2.3.1 => 2.3.2
    npmGlobalPackages:
      typescript: 3.6.4
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x labels Sep 15, 2020
@jiangyuzhen
Copy link
Author

把useDidShow改成useEffect,添加依赖

@xuya227939
Copy link
Contributor

@jiangyuzhen 把useDidShow改成useEffect,添加依赖,老哥什么意思?请问怎么改?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

2 participants