Skip to content

Commit

Permalink
feat(renderer-core): added log when executing setState
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping authored and JackLian committed Apr 17, 2023
1 parent 016d54b commit 5c49044
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/renderer-core/src/renderer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { getLogger } from '@alilc/lowcode-utils';
import baseRendererFactory from './base';
import { IBaseRendererProps, IBaseRenderComponent } from '../types';

const logger = getLogger({ level: 'warn', bizName: 'renderer-core:page' });

export default function pageRendererFactory(): IBaseRenderComponent {
const BaseRenderer = baseRendererFactory();
return class PageRenderer extends BaseRenderer {
Expand Down Expand Up @@ -29,6 +32,11 @@ export default function pageRendererFactory(): IBaseRenderComponent {
super.componentDidUpdate?.(prevProps, _prevState, snapshot);
}

setState(state: any, callback?: () => void) {
logger.info('page set state', state);
super.setState(state, callback);
}

render() {
const { __schema, __components } = this.props;
if (this.__checkSchema(__schema)) {
Expand Down

0 comments on commit 5c49044

Please sign in to comment.