Migration from next-nprogress-bar
Migrate from next-nprogress-bar (v2) to BProgress (v3)
next-nprogress-bar
becomes @bprogress/next
!
Behind this new identity lies a major update to the package, bringing plenty of exciting new features.
As the name has changed, there are a few name changes to be made in the package.
Installation
You need to uninstall next-nprogress-bar
and install @bprogress/next
.
diff - npm uninstall next-nprogress-bar + npm install @bprogress/next
Import
You need to update the import path in your application.
Progress Component
Import
Now you don't import a component but a provider to use the progress bar.
Usage
You'll use the ProgressProvider
in the same place, but since it's a provider, it must be around your children
.
App directory
Pages directory
Router (only for App directory)
The showProgressBar
option is renamed showProgress
.
If you use a custom router, you'll need to make these changes:
Types
The type RouterNProgressOptions
is renamed RouterProgressOptions
.
Data attributes
If you use data attibutes to prevent or disable the progress bar on certain links, you'll need to make these changes:
Custom CSS
One of the great new features of BProgress version 1.1
is the ability to use a custom template anywhere in your code. So we use a class instead of an id to select the element.
If you are using custom CSS you will need to make this change:
Issues
If you encounter any issues, please open an issue on the BProgress repository. We'll be happy to help you as soon as possible!