我的反应应用程序中导入了四个组件。我如何有条件地渲染其中一个组件(基于道具)。这就是我想要做的
<ReactSVGPanZoom
//switch(this.props.Selected){
// case '1': render <ComponentOne/>; break;
// case '2': render <ComponentTwo/>; break;
// case '3': render <ComponentThree/>; break;
// case '4': render <ComponentFour/>; break;
// default: render <ComponentOne/>
}
</ReactSVGPanZoom>