toss / use-funnel

A powerful and safe step-by-step state management library
https://use-funnel.slash.page
MIT License
192 stars 25 forks source link

feat(next-app-router) implement an adapter for next-app-router #75

Open XionWCFM opened 1 month ago

XionWCFM commented 1 month ago

Description

Implement an adapter for next-app-router for the issue discussed in #59.

Related Issue : #59

Context

  1. Currently implemented to operate similarly to @use-funnel/browser. Used for history.state. context, history

  2. useSearchParams in next.js requires suspense, you must wrap suspense when using useFunnel.

How Has This Been Tested

  1. I tested locally whether the value was maintained through history.state even when refreshed.

  2. I checked in the local environment whether the funnel steps were changed appropriately even when using the browser's back and forward functions.

  3. Added test case for funnel.render.overlay.

  4. I tested whether pages using useFunnel could be built without problems.

Further Comments

I look forward to app router users being able to use use-funnel too!

If there is anything else that needs correction, please let me know at any time.

thank you