Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nicnocquee committed Jun 20, 2024
1 parent 9d85e26 commit 311e40c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Minified size](https://img.shields.io/bundlephobia/min/@hyperjumptech/react-next-pathname) ![Test coverage](https://img.shields.io/codecov/c/github/hyperjumptech/react-next-pathname) ![Monthly download](https://img.shields.io/npm/dm/@hyperjumptech/react-next-pathname)

This is a helper tool you can use in your React application to make your it feels faster and smoother when navigating between pages. Say you have a sidebar that contains links to different pages. When you click a link, the component that displays the link will show that it's currently active. Usually like this,
This is a helper tool you can use in your React application to make it feel faster and smoother when navigating between pages. Say you have a sidebar that contains links to different pages. When you click a link, the component that displays the link will show that it's currently active—usually like this:

```tsx
const isPathActive = (pathname: string) => {
Expand Down Expand Up @@ -33,13 +33,13 @@ const Sidebar = () => {
};
```

The problem is when the clicked page is slow to load because of bad network condition or slow server response, the clicked link will not immediately show that it's active. This is because the `window.location.pathname` is not updated until the page has fully loaded. The users might think that there is nothing happening when they click the link, and they will be confused.
The problem is that when the clicked page is slow to load due to bad network conditions or slow server response, the clicked link will not immediately show that it's active. This is because the `window.location.pathname` is not updated until the page has fully loaded. Users might think that nothing is happening when they click the link, and they will be confused.

This library helps you solve this problem by allowing you to get the next pathname immediately when a link is clicked, without waiting for the new page to load.

## Installation

To install `@hyperjumptech/react-next-pathname`, run the following command:
To install `@hyperjumptech/react-next-pathname`, run one of the following commands:

**NPM**

Expand Down

0 comments on commit 311e40c

Please sign in to comment.