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
Now that the context.location has been removed in favor of <LocationSubscriber> I believe that it would be useful to know when not to subscribe and optimize for those situations. The only <Link> components that need to know location information are ones that care about whether or not they are active.
// care when:// activeStyle is provided<LinkactiveStyle={{color: 'blue'}}to='/foo'>Foo</Link>// activeClassName is provided<LinkactiveClassName='active'}to='/bar'>Bar</Link>// children is a function<Linkto='/seuss'>{({isActive, ...rest})=>(<a{...rest}className={isActive ? 'one fish' : 'two fish'}>{isActive ? 'red fish' : 'blue fish'}</a>)}</Link>// doesn't care<Linkto='/quux'>Quux</Link>
I believe that those are the only cases where location information is necessary. When none of those three cases are true, the <Link> should be able to return an <a> that is not wrapped with a <LocationSubscriber>.
The text was updated successfully, but these errors were encountered:
Now that the
context.location
has been removed in favor of<LocationSubscriber>
I believe that it would be useful to know when not to subscribe and optimize for those situations. The only<Link>
components that need to know location information are ones that care about whether or not they are active.I believe that those are the only cases where location information is necessary. When none of those three cases are true, the
<Link>
should be able to return an<a>
that is not wrapped with a<LocationSubscriber>
.The text was updated successfully, but these errors were encountered: