我有以下反应组件:
<HashRouter>
<div className="App">
{/* Static section */}
<div>
<NavBar title="MyApp" />
</div>
{/* Dynamic section */}
<div>
<Route path="//" component={HomePage} />
<Route path="/market" component={MarketPage}/>
</div>
</div>
</HashRouter>
并且 NavBar
组件期望渲染子组件将根据Ant设计component表示网站内容 . 我的问题是如何在不重新渲染导航栏的情况下在导航栏组件中渲染子组件?我在导航栏中有一个,但我不知道在不强制导航栏再次渲染的情况下注入道具的位置 .