1
작동하지 "/"정확한 경로 라우터 V4 반응하지만 내가 exact
단어를 삭제은 코르도바의 플러그인 IntelXDK에서이 작업을 수행하려고 코르도바
const app = document.getElementById('app');
const Index =() => (
<Router>
<div>
<Switch>
<Route exact path="/" component={Layout}/>
<Route path="/about" component={First}/>
<Route path="/topics" component={Second}/>
</Switch>
</div>
</Router>
);
const Layout =() => (
<div>
<h1>layout</h1>
<ul>
<li><Link to="/">Home</Link></li>
<li><Link to="/about">About</Link></li>
<li><Link to="/topics">Topics</Link></li>
</ul>
</div>
);
const First =() => (
<div>
<h1>first</h1>
</div>
);
const Second =() => (
<div>
<h1>second</h1>
</div>
);
ReactDOM.render(<Index/>, app);
하지가 <Switch>
태그를 사용하여 아무것도 표시되지 않습니다 그것은 작동하지만 레이아웃과 첫 번째 또는 두 번째 구성 요소를 렌더링합니다.
하나의 구성 요소 만 렌더링하고 싶습니다. 누군가이 문제를 해결할 수 있습니까?