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

Feat: rn event target #1753

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Feat: rn event target #1753

wants to merge 13 commits into from

Conversation

yandadaFreedom
Copy link
Collaborator

No description provided.

@@ -477,7 +477,8 @@ interface LayoutConfig {
export const useLayout = ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
const layoutRef = useRef({})
const hasLayoutRef = useRef(false)
const layoutStyle: Record<string, any> = !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}
const isFirstRender = useRef(true)
const layoutStyle: Record<string, any> = isFirstRender.current && !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const layoutStyle = useMemo(()=>{return !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}}, [hasLayoutRef.current])

应该改为上面这种,不然第二次渲染必定会show,还是可能造成闪烁

@@ -41,10 +41,22 @@ const getTouchEvent = (
}
)

const pendingProps = (event as any)._targetInst?.pendingProps || {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个东西试一下生产模式和安卓下是否都存在

@@ -477,7 +477,8 @@ interface LayoutConfig {
export const useLayout = ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => {
const layoutRef = useRef({})
const hasLayoutRef = useRef(false)
const layoutStyle: Record<string, any> = !hasLayoutRef.current && hasSelfPercent ? HIDDEN_STYLE : {}
const isFirstRender = useRef(true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants