facebookexperimental / Recoil

Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
https://recoiljs.org/
MIT License
19.61k stars 1.18k forks source link

What is the proper way of URL encoding for external links #2233

Open ghost opened 1 year ago

ghost commented 1 year ago

User case

By clicking the COMPARE PLAYERS button, I can select players and open them in an external link with the goal of sharing the atom state between two different pages.

animation

Question

What's the proper way to achieve it? Is it just to use the JavaScript encodeURIComponent function?

image

This Recoil documentation page does not seem to cover it, so I'd like to clarity it here