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

Add random id prefix to input ids #13

Closed
danielweinmann opened this issue May 4, 2022 · 5 comments
Closed

Add random id prefix to input ids #13

danielweinmann opened this issue May 4, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@danielweinmann
Copy link
Contributor

No description provided.

@felipefreitag felipefreitag added the enhancement New feature or request label Jul 15, 2022
@andrepinho
Copy link
Contributor

andrepinho commented Jul 15, 2022

Perhaps React's useId hook can help us achieve that.

@gustavoguichard
Copy link
Contributor

@andrepinho thought the same but this is only react@^18 . Not sure if we can use it yet.

@gustavoguichard gustavoguichard added the good first issue Good for newcomers label Jul 27, 2022
@felipefreitag
Copy link
Contributor

What should be the approach here then? Generate any random string?

@danielweinmann danielweinmann removed the good first issue Good for newcomers label Dec 8, 2022
@danielweinmann
Copy link
Contributor Author

@felipefreitag, the random string should be shared between the server and client to avoid hydration errors. Once we implement #124, we'll have a Context for each field. That might help with this issue: if we store the random id in the Context, it will be shared. Maybe we wait for #124?

@gustavoguichard
Copy link
Contributor

We can use useId now that v3 is gonna require react@18.
I'm closing this issue since it is a duplicate of #238

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

No branches or pull requests

4 participants