-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
the dark / light switch on demo website should be instant. #20
Comments
@delata It seems to be instantaneous for me on the latest versions of Chrome, Firefox, and Safari on MacOS. Would you mind showing a video? |
i am using chrome ( actually Brave) on android running on a 3 years old 75 dollar phone. |
again you are running on a macbook. |
I'm running it on a Samsung Galaxy A40 which costes $150 when it was new a year ago but it takes at most a second to change. Are you sure it is not causes by addons or other applications slowing down your phone? Also I'm running it on firefox, maybe try that as well. |
this is a problem, i have used other websites that had this kind of mechanism, but they were smooth on my phone. |
Were they also written in react or just switched stylesheets? |
i don't know, they were simple website. the whole react thing is a garbage. worse thing is that people are now using it every where. |
@delata I see what you're talking about: 6x Slowed CPU + 3G, but I believe this is just the result of making large changes to the DOM on slower devices, which is why you don't notice it on other websites. I think a solution could be to maybe make the opposite version (dark/light) hidden instead of completely removed from the DOM; however, this feels like an edge case. |
They're two separate React components which are removed and added with the switch, which causes quite a bit of distress to the CPU, etc.. Only around ten CSS classes are changed, so I can see possible merging these two components into one, but it will reduce readability of the source code. |
I was talking about the other websites, if they were switching stylesheets or also are written in react. I am well aware how this library handles it, given that I've read the source code. |
@Anachron Sorry, I guess I misread it. |
it takes more than a seconds. and lags. it should me smooth.
The text was updated successfully, but these errors were encountered: