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

docs: renamed hello state to name in hero section demo #611

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

johurul-haque
Copy link

The demo in the hero section contains the state for handling the input field. The state variables for that are hello and setHello; for storing the name of the user it would be better to rename them to name and setName.

Copy link

vercel bot commented Aug 14, 2024

@johurul-haque is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

@franky47
Copy link
Member

Thanks for the suggestion!

This is a good occasion to highlight something important with URL state: migrations like this can (and will) break existing URLs.

I don't mind merging the change in variable name, but the query key should remain the same to ensure existing URLs are still valid. But doing so, the variable name would be decoupled from its key.

So what's the best way to handle such migrations? One way is to rewrite the query string with middleware. It may break locality of behaviour, but it also centralises the migration code.

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

Successfully merging this pull request may close these issues.

2 participants