내 애플리케이션을 React Router v4로 업그레이드 이전에는 탐색시 팝업 메뉴 숨기기를 사용했던 이전 onUpdate 로직을 구현하는 데 어려움을 겪고 있습니다.React Router v4 라이프 사이클 이벤트
설명서에서 볼 수있는 유일한 방법은메서드를 활용하는 것입니다. 그러나 이전보다 훨씬 복잡한 것처럼 보입니다 - 더 쉬운 해결책은 무엇입니까?
const HidePopupThenRoute = ({ component: Component, ...rest }) => (
<Route {...rest} render={matchProps => {
hidePopup();
return <Component {...matchProps}/>
}}/>
)
<HidePopupThenRoute path="/" component={MyComponent}/>