---
title: "Discussion on \"Uncaught Error: useNavigate() may be used only in the context of a <Router> component\" | Hashnode"
description: "Discussion on \"Uncaught Error: useNavigate() may be used only in the context of a <Router> component\". Problem\nI was trying to implement the useNavigate() hook in my React application, but I kept getting an error on my console.\n\nAfter a bit of digging, I discovered that the issue was with the way I had set up my router. Specifically, the BrowserRouter..."
url: "https://hashnode.com/posts/uncaught-error-usenavigate-may-be-used-only-in-the-context-of-a-router-component/63d99ce2f391025880c80af0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Uncaught Error: useNavigate() may be used only in the context of a <Router> component](https://kodervine.hashnode.dev/uncaught-error-usenavigate-may-be-used-only-in-the-context-of-a-router-component?utm_source=hashnode&utm_medium=feed)

Problem I was trying to implement the useNavigate() hook in my React application, but I kept getting an error on my console. After a bit of digging, I discovered that the issue was with the way I had set up my router. Specifically, the BrowserRouter...

Jan 31, 2023 · 2 min read · kodervine.hashnode.dev  
Read the article

-   [#error-handling](https://hashnode.com/tag/error-handling)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#bugs-and-errors](https://hashnode.com/tag/bugs-and-errors)

## Written by

[Chinenye Anikwenze](https://hashnode.com/@kodervine)

@kodervine · Remote

  
[View profile](https://hashnode.com/@kodervine)

Software developer && Technical writer

I create stunning user-friendly web apps that engage and simplify the user experience on the client side. I love the intersection of solving customer problems while making their journey seamless. My current focus is building modular AI architectures using n8n, which allows me to deploy private, high-speed automation on self-hosted VPS environments. I am also a technical writer. I share my journey through articles on new technologies, tutorials, and walkthrough into the bugs I encounter. My goal is to explain how I resolved those issues to help other developers build better, faster code

## Responses 1

Markdown supported · ⌘↵ to post

[Favour Abangwu](https://hashnode.com/@theefayy)

[Feb 16, 2023](https://hashnode.com/posts/uncaught-error-usenavigate-may-be-used-only-in-the-context-of-a-router-component/63d99ce2f391025880c80af0/comment/63ee442646e2f1644c4f1786)

Haven’t encountered the error yet. But I know what to do when it happens. Thanks. 👍

[Chinenye Anikwenze](https://hashnode.com/@kodervine)

[Feb 16, 2023](https://hashnode.com/posts/uncaught-error-usenavigate-may-be-used-only-in-the-context-of-a-router-component/63d99ce2f391025880c80af0/comment/63ee442646e2f1644c4f1786#reply-63ee58b03c9c765be7a455d4)

Sure thing 😌😌 That error message can be annoying tbh
