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

[Feature]:Should id param on useFunnel always be needed? #62

Open
bigsaigon333 opened this issue Sep 23, 2024 · 2 comments
Open

[Feature]:Should id param on useFunnel always be needed? #62

bigsaigon333 opened this issue Sep 23, 2024 · 2 comments

Comments

@bigsaigon333
Copy link
Contributor

bigsaigon333 commented Sep 23, 2024

Package Scope

@use-funnel/core

Description

I want the id parameter on useFunnel to be optional, and I want the URL to remain as ?step=stepName without the id. prefix.

Currently, the id parameter is required, and it appears in the URL as ?id.step=stepName

My goal is to simplify this by skipping the id. and just using step as the name of the searchParams.

I’m only using one useFunnel hook on the page, so having just step in the URL should work fine for me.

Can you guys consider this feature?

const funnel = useFunnel<{ A: {}; b: {} }>({
//  id: '',    <--- I want id parameter to be optional!! and remains in th url ?step=A
  initial: { step: 'A', context: {} },
});

Possible Solution

No response

etc.

No response

@bigsaigon333
Copy link
Contributor Author

I tried using useFunnel({ id: "" }), but the period (.) still remains in the URL as ?.step=A

@minuukang
Copy link
Member

Because about sub funnel concept. it should be a unique id in component tree.

But your suggestion seems like a good enough need. We'll consider adding an option to customize it!

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

2 participants