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-relatons #1679

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

Conversation

CommanderXL
Copy link
Member

No description provided.

const root = rawOptions.options?.disableMemo ? proxy.effect.run() : useMemo(() => proxy.effect.run(), [proxy.stateVersion])
const runRenderEffect = () => {
if (needRelationContext(rawOptions)) {
return createElement(RelationsContext.Provider, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接包在root上就可以了吧

@@ -117,6 +118,7 @@ global.currentInject.firstPage = ${JSON.stringify(firstPage)}\n`
content += `global.currentInject.getComponents = function () {
return ${shallowStringify(componentsMap)}
}\n`
content += `global.currentInject.componentPath = '/' + ${JSON.stringify(outputPath)}\n`
Copy link
Collaborator

Choose a reason for hiding this comment

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

页面是不是不用注入

})
}

const RelationsContext = createContext(null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

context可以以outputPath为key存一系列

if (item.type?.__mpxBuiltIn) { // 如果是基础节点,继续向下查找
return isChildNode(item, instance)
} else {
return item.type === instance.__getReactFunctionComponent()
Copy link
Collaborator

Choose a reason for hiding this comment

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

光凭这个ctor也没办法判断当前的instance一定是child吧

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