-
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
fix(alipay): support root-portal component #14171
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRouter } from '@tarojs/taro'
import { createPortal } from "@tarojs/react";
import { useLayoutEffect, useState } from "react";
const RootPortal = ({ children, enable = true }) => {
const router = useRouter()
const [dom, setDom] = useState()
useLayoutEffect(() => {
const _dom = document.getElementById(router.$taroPath);
_dom && setDom(_dom)
}, [router.$taroPath])
return (enable && dom) ? createPortal(children, _dom) : children
}
export default RootPortal 可以暂时用这个 |
Chen-jj
approved these changes
Oct 31, 2023
感谢贡献~ |
moseszhou
added a commit
to moseszhou/taro
that referenced
this pull request
Nov 1, 2023
* next: fix: 修复babel-plugin-transform-taroapi插件对canIUse入参scheme处理问题 (NervJS#14717) feat: deriveDataFromProps逻辑抽离到/plugin-platform-alipay fix(alipay): support root-portal component (NervJS#14171) fix(plugin-inject): 修复 Vue2 使用 componentsMap 配置时报错的问题,NervJS#13299 NervJS#14520 (NervJS#14607) fix(weapp): `Map` attribute replenishment refactor(types): sync components types fix(weapp): `LivePlayer` attribute replenishment (NervJS#14668) fix(tt): `Input` attribute replenishment types: 根据文档补充配置 enableSourceMap 类型 fix(weapp): 完善微信小程序视频号相关组件的属性实现,fix NervJS#14608 chore: 添加提示文案 fix: 支付宝渲染问题, 当页面复杂,CustomWrapper和page都有数据更新时,CustomWrapper的UI有几率出现不更新的情况 Revert "perf: rn端sass文件引入路径包含别名时支持~,例如: @import ’~@/common/baseStyle.scss‘"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#14168
这个 PR 做了什么? (简要描述所做更改)
支持支付宝小程序
root-portal
组件https://opendocs.alipay.com/mini/05snwp
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: