GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: low-code components support lifecycle and function execution · shibiaoz/lowcode-engine@176583f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • rax-simulator-renderer/src
      • renderer.ts
    • react-simulator-renderer/src
      • renderer.ts
    • renderer-core/src/renderer
      • component.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/rax-simulator-renderer/src/renderer.ts‎

Copy file name to clipboardExpand all lines: packages/rax-simulator-renderer/src/renderer.ts
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
501501
const _schema: any = {
502502
...compatibleLegaoSchema(schema),
503503
};
504-
_schema.methods = {};
505-
_schema.lifeCycles = {};
506504

507505
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
508506
const doc = window.document;
Collapse file

‎packages/react-simulator-renderer/src/renderer.ts‎

Copy file name to clipboardExpand all lines: packages/react-simulator-renderer/src/renderer.ts
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
428428
const _schema: any = {
429429
...compatibleLegaoSchema(schema),
430430
};
431-
_schema.methods = {};
432-
_schema.lifeCycles = {};
433431

434432
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
435433
const doc = window.document;
Collapse file

‎packages/renderer-core/src/renderer/component.tsx‎

Copy file name to clipboardExpand all lines: packages/renderer-core/src/renderer/component.tsx
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export default function componentRendererFactory(): IBaseRenderComponent {
3232

3333
const noContainer = this.__parseData(__schema.props?.noContainer);
3434

35+
this.__bindCustomMethods(this.props);
36+
3537
if (noContainer) {
3638
return this.__renderContextProvider({ compContext: this });
3739
}
@@ -44,5 +46,12 @@ export default function componentRendererFactory(): IBaseRenderComponent {
4446

4547
return this.__renderComp(Component, this.__renderContextProvider({ compContext: this }));
4648
}
49+
50+
/** 需要重载下面几个方法,如果在低代码组件中绑定了对应的生命周期时会出现死循环 */
51+
componentDidMount() {}
52+
getSnapshotBeforeUpdate() {}
53+
componentDidUpdate() {}
54+
componentWillUnmount() {}
55+
componentDidCatch() {}
4756
};
4857
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.