How does react log in to intercept beforeEach (), a hook function similar to that provided by vue-router?

how does react intercept login? only if you log in, you have the right to access the page, similar to the hook function beforeEach provided by vue-router

.
Dec.07,2021
Menu