devrnt / react-use-wizard

🧙 A React wizard (stepper) builder without the hassle, powered by hooks.

Home Page:https://devrnt.github.io/react-use-wizard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work with next 11

johnschult opened this issue · comments

I ran the next example using this package.json and you cannot advance to the next step.

{
  "name": "nextjs",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "^11",
    "react": "^17",
    "react-dom": "^17",
    "react-use-wizard": "^1"
  }
}

Screen Shot 2021-07-15 at 8 15 36 AM

After clicking Next...

Screen Shot 2021-07-15 at 8 15 49 AM

No console messages or errors.

Solved by changing the calls to nextStep and previousStep...

<div>
  <button
    onClick={() => previousStep()}
    disabled={isLoading || isFirstStep}
  >
    Previous
  </button>
  <button onClick={() => nextStep()} disabled={isLoading || isLastStep}>
    Next
  </button>
</div>

Good catch, will fix the examples. It's because the event is being passed implicitly.

This was working in previous versions since you couldn't pass an index to previousStep and nextStep

Closed in #53