This repository has been archived by the owner on Jul 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Utilize multiple contexts for performance #21
Labels
enhancement
New feature or request
Comments
jamesplease
changed the title
Multiple contexts
Utilize multiple contexts for performance
Jun 28, 2019
This change may still cause A to rerender because A subscribes to get its own node within a Focusable component. |
A more appropriate solution is described here: reactjs/rfcs#119 However, since that is just an RFC, I'll likely move to:
Each hook/Focusable will subscribe to the Focus Tree rather than Context. In this way, re-renders will be minimized considerably. If the selector RFC ever lands, I can refactor back to using Context in a less roundabout way. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider the following:
In this situation, Subtree B is changing the global context (because the focus tree
nodes
are changing), causing Subtree A to render unnecessarily.The focus hierarchy state should be separate from the node state. That way, consumers of what's focused won't be affected by changes to the rest of the focus tree state.
The text was updated successfully, but these errors were encountered: