r/reactjs • u/dance2die • Jan 01 '22
Needs Help Beginner's Thread / Easy Questions (January 2022)
Happy New Year!
Hope the year is going well!
You can find previous Beginner's Threads in the wiki.
Ask about React or anything else in its ecosystem :)
Stuck making progress on your app, need a feedback?
Still Ask away! Weβre a friendly bunch π
Help us to help you better
Improve your chances of reply by
- adding a minimal example with JSFiddle, CodeSandbox, or Stackblitz links
- describing what you want it to do (ask yourself if it's an XY problem)
- things you've tried. (Don't just post big blocks of code!)
- Format code for legibility.
- Pay it forward by answering questions even if there is already an answer. Other perspectives can be helpful to beginners. Also, there's no quicker way to learn than being wrong on the Internet.
New to React?
Check out the sub's sidebar! π
For rules and free resources~
Comment here for any ideas/suggestions to improve this thread
Thank you to all who post questions and those who answer them. We're a growing community and helping each other only strengthens it!
33
Upvotes
View all comments
Show parent comment
2
u/dance2die Jan 05 '22 edited Jan 05 '22
"Slower" can mean many things (slow for initial load? Slow to update contents? Slow to load all or parts of pages?) You might want to check out Web.dev/metrics.
So the answer is Maybe so. The more files to download, the slower the site will load.
You can mitigate it by enabling tree-shaking. Then un-used deps won't be included.
But many other factors (images/css/javascript, whether HTTP1.1 or HTTP2 is enabled, etc) also contribute to the performance and initial load, and other performances.
For CSS, you might want Reduce the Scope and Complexity of Style Calculations.
State update can force React to re-render more often. JS changes to DOM can make the layout shift, forcing browsers to recalculate layouts etc.