Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for nprogress.start() and nprogress.done() Functions to be Added to nextjs-progressbar #104

Open
in-ch opened this issue Oct 26, 2023 · 0 comments

Comments

@in-ch
Copy link

in-ch commented Oct 26, 2023

I implemented an onClick event function that allows the <Link> component to display a confirmation modal whenever the page is moved as follows.

e.preventDefault();

handleShowModal(
    commonModal({
          title: 'title',
          description: 'description',
          handleClickClose: () => {
             handleHideModal();
             NProgress.done(true);
          },
          handleClickOk: () => {
            router.replace(`${href}`);
          },
    }),
);

The issue I'm facing is that NProgress starts appearing at the top before e.preventDefault() gets executed due to <Link> component. To resolve this, I had to install nprogress and @types/nprogress additionally, which I find less than ideal.

Is it possible that nextjs-progressbar, which already includes nprogress as a dependency, supports nprogress.start() and nprogress.done() functionalities?

I'm curious if it could handle this without the need for additional installations, similar to how it's done locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant