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

RecoilURLSync has unnecessary encodeURIComponent for search serializer #2291

Open
alexeychikk opened this issue Oct 19, 2023 · 0 comments
Open

Comments

@alexeychikk
Copy link

alexeychikk commented Oct 19, 2023

I don't understand why do you need encodeURIComponent since you already delegate serialization to the user

url.search = encodeURIComponent(serialize(unwrapState(items)));

My use-case is the following:

import { parse, stringify } from 'query-string';
// ...
          <RecoilURLSync
            serialize={stringify}
            deserialize={parse}
            location={{ part: 'search' }}
          >

This redundant encodeURIComponent encodes = and & characters in the already serialized string.
For example gameId=foo&gameId=bar becomes gameId%3Dfoo%26gameId%3Dbar

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

1 participant