onEnter not called in React-Router

后端 未结 2 1837
刺人心
刺人心 2020-12-01 02:29

Ok, I\'m fed up trying.
The onEnter method doesn\'t work. Any idea why is that?

// Authentication \"before\" filter
function requireAuth(ne         


        
2条回答
  •  失恋的感觉
    2020-12-01 03:22

    onEnter no longer exists on react-router-4. You should use to get your desired functionality. I believe Redirect example has your specific scenario. I modified it below to match yours.

     (
      isLoggedIn() ? (
        
      ) : (
        
      )
    )}/>
    

提交回复
热议问题