You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Children of A usually need to react to the active state. Currently, it can only be implemented by useMatch or useLocation. A has already the logic of active state checking, so why not exposing it to its descents through a context? As one of the benefits, the active state obtained by the descents through a context is consistent with the end prop on A.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Children of
A
usually need to react to the active state. Currently, it can only be implemented byuseMatch
oruseLocation
.A
has already the logic of active state checking, so why not exposing it to its descents through a context? As one of the benefits, the active state obtained by the descents through a context is consistent with theend
prop onA
.I made a POC:
And with this we can easily retrieve the active state in descent compoments:
Beta Was this translation helpful? Give feedback.
All reactions