lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

@alilc/lowcode-utils 中 buildComponents 里未兼容 rax 组件相关逻辑导致 rax 组件预览失败

Open jinchanz opened this issue 2 years ago • 0 comments

Describe the bug (required) / 详细描述 bug(必填)

@alilc/lowcode-utils 中 buildComponents 里未兼容 rax 组件相关逻辑,对于没有接收 ref 的组件直接封装成 react 组件,导致 rax 组件渲染不成功;

https://github.com/alibaba/lowcode-engine/blob/86b8889ec4c8e612528101879c31ea0f1642bb99/packages/utils/src/build-components.ts#L115

component = findComponent(libraryMap, componentName, component);
if (component) {
  if (!acceptsRef(component)) {
    component = wrapReactClass(component as FunctionComponent);
  }
  components[componentName] = component;
}

To Reproduce (required) / 如何复现 bug?(必填,非常重要)

  1. npm init @alilc/element rax-single-comp-1026 --registry=https://registry.npmmirror.com ;
  2. cnpm i ;
  3. npm run lowcode:dev 打开 http://localhost:3333 , 拖入组件;
  4. 点击预览,白屏;

jinchanz avatar Oct 25 '22 18:10 jinchanz