1

例如,假设我有这样的架构:

class ComponentSchema{};
ComponentSchema.schema = {
  name: 'Component',
  properties: {
    jsx: 'What goes here?'
  }
}

class ContainerSchema{};
ContainerSchema.schema = {
  name: 'JSXComponents',
  properties: {
    components: {type: 'list', objectType: 'Component'}
  }
}

有没有办法将组件推送到JSXComponents.components列表中,以便它可以存储代表:

{0: {jsx: <Component/>}, 1: {jsx: <OtherComponent/>}}

如果 JSX 组件没有特定的数据类型,是否有解决方法?

4

0 回答 0