{background && <Route path="/shorts/:shortId" element={<Modal />} /> }
我想显示一个模态组件,而其他组件仍在后台运行。
在路由器v6中试试这个,它会成功的。
<Route path="/shorts" element={<Modal />}>
<Route path=":shortId" element={<Modal />} />
</Route>