-
Notifications
You must be signed in to change notification settings - Fork 381
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
base: master
Are you sure you want to change the base?
[feat]rn-relatons #1679
Conversation
const root = rawOptions.options?.disableMemo ? proxy.effect.run() : useMemo(() => proxy.effect.run(), [proxy.stateVersion]) | ||
const runRenderEffect = () => { | ||
if (needRelationContext(rawOptions)) { | ||
return createElement(RelationsContext.Provider, { |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
页面是不是不用注入
}) | ||
} | ||
|
||
const RelationsContext = createContext(null) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
光凭这个ctor也没办法判断当前的instance一定是child吧
No description provided.