Tepki almayla ilgili ana sorun, yavaş olabilmesidir.
There is no built-in way to get the current route in React. However, you can use the router's context to get the current location, which will give you the current pathname. const { location } = this.context.router; console.log(location.pathname); // /some/path
isim
uselocation() kancası
Uselocation() kancası, bir bileşenin kökte oluşturulup oluşturulmayacağını belirlemek için kullanılır. Bileşenin kökte işlenmemesi gerekiyorsa, bunun yerine nerede işlenmesi gerektiğini belirlemek için bu kancayı kullanabilir.
rotalar nasıl alınır
React'te rota almanın birkaç yolu vardır. Bunun bir yolu, tepki yönlendirici kullanmaktır. Başka bir yol da tepki-yönlendirici-dom kullanmaktır.