首页 > 解决方案 > 没有构建 KeysToComponentMap 的动态组件引用?

问题描述

我认为答案是否定的,但希望是永恒的?

var TabComponent = React.createElement(Dashboard, {});
        return TabComponent;

Dashboard 是否可以被变量 tabName="Dashboard" 替换,而无需使用键:值对构建对象并使用

return React.createElement(
      KeysToComponentMap[config.component]

解决方案?

标签: reactjs

解决方案


推荐阅读