Skip to content

Commit

Permalink
add migrate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyleen77 committed Jul 4, 2023
1 parent ecb17a9 commit 405226c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- [App directory router](#app-directory-router)
- [Import](#import)
- [Use](#use)
- [Migrating from v1 to v2](#migrating-from-v1-to-v2)
- [Issues](#issues)
- [LICENSE](#license)

Expand Down Expand Up @@ -311,6 +312,57 @@ const router = useRouter();
router.push('/about');
```

## Migrating from v1 to v2

### Pages directory

```jsx
// before (v1)
import ProgressBar from 'next-nprogress-bar';

<ProgressBar
height="4px"
color="#fffd00"
options={{ showSpinner: false }}
shallowRouting
/>;

// after (v2)
import { PagesProgressBar as ProgressBar } from 'next-nprogress-bar';

<ProgressBar
height="4px"
color="#fffd00"
options={{ showSpinner: false }}
shallowRouting
/>;
```

### App directory

```jsx
// before (v1)
import ProgressBar from 'next-nprogress-bar';

<ProgressBar
height="4px"
color="#fffd00"
options={{ showSpinner: false }}
appDirectory
shallowRouting
/>;

// after (v2)
import { AppProgressBar as ProgressBar } from 'next-nprogress-bar';

<ProgressBar
height="4px"
color="#fffd00"
options={{ showSpinner: false }}
shallowRouting
/>;
```

## Issues

Please file an issue for bugs, missing documentation, or unexpected behavior.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-nprogress-bar",
"version": "2.0.0",
"version": "2.0.1",
"description": "NextJS progress bar compatible with new app directory",
"repository": {
"type": "git",
Expand Down

0 comments on commit 405226c

Please sign in to comment.