Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noticeable lag in setting active class on Link #1242

Closed
NicholasGWK opened this issue Jun 1, 2015 · 4 comments
Closed

Noticeable lag in setting active class on Link #1242

NicholasGWK opened this issue Jun 1, 2015 · 4 comments

Comments

@NicholasGWK
Copy link

I have a page that has a pretty large render + lots of aysnc going on, but I haven't been able to diagnose the cause of this issue. When I click a new link, there is a long, noticeable delay in when the link adds the active class. It appears even after all the rendering and network activity as stopped, there can still be a long delay (5 seconds or so). Wondering if anyone else is experiencing this behaviour or has a workaround, otherwise I'm looking at imperatively modifying the class in componentDidMount for each of my sub-views.

Links are sidebar nav icons, and the active class gives them a shaded background, if that matters.

@mjackson
Copy link
Member

@NicholasGW Would you mind upgrading and testing your site on version 1.0.0-beta2? The current code implements the isActive check as a simple string comparison, so perf should improve considerably 99% of the time.

@gaearon
Copy link
Contributor

gaearon commented Jun 18, 2015

Do any components between the <Link> and the <Router> implement shouldComponentUpdate?
This might be the same problem as #470 and facebook/react#2517.

@ryanflorence
Copy link
Member

Link now listens to the history to know if its active, so they should be much faster now on re-renders, though time will tell if they are slower now to set up 😐

Closing and hoping for no new tickets to come in saying the new implementation is slow 🙏

@billyshena
Copy link

billyshena commented Sep 11, 2016

@ryanflorence Do you still have this issue?
I'm also currently rendering <Link> dynamically and I can notice a small delay when the active class is set on the component.
Did listen to the history fixed the performance problem ?

Best,

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants