Closed
Description
(Documentation only) feature request
There is a set of cases, when you need to read context only once. Read without any future update, so no subscription is needed - mount effect
are a great example of this.
Some libraries already using this pattern, for example sweet-state
uses readContext
("a hack") to just get the data from React, in a same "no update" mode.
I think this pattern should be documented, but it seems a bit wrong to use useContext
to do so, as long as there are some expectations about how useContext
is working.
What do you think about useUntrackedContextSelector
? The same useContextSelector
, but "untracked"?
Metadata
Metadata
Assignees
Labels
No labels