Skip to content

Refactor ProfilerContext to use reducer instead of multi-state #16444

Open
@bvaughn

Description

The ProfilerContext is currently comprised of several pieces of related state, each managed with useState. This necessitates awkward checks like this or even worse like this or this.

This context should be refactored to use a single reducer (useReducer) like TreeContext. This is a bit more involved at the moment because of suspense and the ProfilerContext being higher level than the suspense cache. Although maybe we could work around this by using some sort of subscription?

See related issues like #16441 and commit 4697f5b.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions