Why doesn’t Recoil manage the unique key in atom and selector
See original GitHub issueI don’t see that the user needs to use the defined key anywhere. So why does he/she needs to create it manually ?
const textState = atom({
key: 'textState', // this is used nowhere, why not just abstract it out?
default: '',
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:14 (2 by maintainers)
Top Results From Across the Web
selector(options) - Recoil
Recoil manages atom and selector state changes to know when to notify components ... key - A unique string used to identify the...
Read more >Lessons learned from moving to Recoil.js - Kitemaker blog
This is because selectors are not updated as the individual operations of a transaction are applied to the recoil state, so the data...
Read more >Multiple form values in one react recoil atom override each other
However, the idiomatic way to do this (and where Recoil becomes more powerful) is composition of atom s using a selector , which...
Read more >Top 6 React state management libraries for 2022
The core concepts to understand in Recoil are atoms and selectors. ... In contrast, Jotai doesn't require keys and depends entirely upon ......
Read more >Jotai vs. Recoil: What are the differences? - LogRocket Blog
This article compares the state management libraries to help you ... In fact, Jotai atom is used to implement both atom and selector...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My team is looking into adopting Recoil for a project, but since we expect the project to grow and stay around for a long time, we’re very concerned about key collisions happening. It seems like a landmine whose surface area gets bigger and bigger the more you work on an app. Maybe generate a key internally as a fallback, but have tutorials and documentation strongly encourage adding an optional
name
value to the atom definition?naming is really hard.
since
key
can be generated automatically using tools likeuuidv4()
, I want Recoil to handle the task for me.Human is unreliable, easy to make names conflict.
please save me from naming.