Scope Chain
Default Scope Chain Logic
For details, see: Scope in Canvas
Customize in editor-props
The customization logic for the scope is usually done in editor-props through variableEngine.chainConfig.
use-editor-props.tsx
// ...
{
// ...
variableEngine: {
enable: true,
chainConfig: {
// Customize scope chain logic
}
}
// ...
}
// ...
Whether child nodes can be depended on by subsequent nodes
By default, child nodes cannot be depended on by subsequent nodes of the parent node.
If you need to customize this logic, you need to configure it in variableEngine.chainConfig.isNodeChildrenPrivate.
use-editor-props.tsx
{
variableEngine: {
enable: true,
chainConfig: {
/**
* Customize: Whether child nodes can be depended on by subsequent nodes of the parent node
*/
isNodeChildrenPrivate(node) {
// When a certain type of custom node is hit, allow its child nodes to be depended on by subsequent nodes
if (node.flowNodeType === 'Your_Custom_Type') {
return false;
}
// Otherwise: by default, child nodes are not allowed to be depended on by subsequent nodes
return true;
},
}
}
}