Skip to content

zero update propagation Context #3

Closed
@theKashey

Description

@theKashey

(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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions