Optimizing React Apps in Practice
marmelab.com
Optimizing React Apps in Practice
1–10 of 10 posts
Re: Optimizing React Apps in Practice
#2It's hard to know if this is due to the way the article is written but it seems like you're sacrificing both developer ergonomics and runtime performance in this situation. I am curious to hear about similar scenarios in competing frameworks like Vue.
Re: Optimizing React Apps in Practice
#3Re: Optimizing React Apps in Practice
#4A few choice websites have definitely colored my view of React (e.g. Airbnb, multi-second delay clicking onto a form text field on current generation Android and iPhone? I hope they see some of the techniques in this article). It's hard to know if this is due to the way the article is written but it seems like you're sacrificing both developer ergonomics and runtime performance in this situation. I am curious to hear…
That doesn't make any sense. Whatever's happening there, highly unlikely it is due to React. I've run React apps on iOS for years with none of those issues.
Re: Optimizing React Apps in Practice
#5Re: Optimizing React Apps in Practice
#6A few choice websites have definitely colored my view of React (e.g. Airbnb, multi-second delay clicking onto a form text field on current generation Android and iPhone? I hope they see some of the techniques in this article). It's hard to know if this is due to the way the article is written but it seems like you're sacrificing both developer ergonomics and runtime performance in this situation. I am curious to hear…
Re: Optimizing React Apps in Practice
#7React really should be able to detect object literals in style components and optimize those away into a const under the hood. Hopefully this is fixed in a future version.
Re: Optimizing React Apps in Practice
#8A few choice websites have definitely colored my view of React (e.g. Airbnb, multi-second delay clicking onto a form text field on current generation Android and iPhone? I hope they see some of the techniques in this article). It's hard to know if this is due to the way the article is written but it seems like you're sacrificing both developer ergonomics and runtime performance in this situation. I am curious to hear…
Re: Optimizing React Apps in Practice
#9React really should be able to detect object literals in style components and optimize those away into a const under the hood. Hopefully this is fixed in a future version.
If you know that a given style object is never going to change, you can hoist it out of your component's render method into the module scope yourself.
Re: Optimizing React Apps in Practice
#10React really should be able to detect object literals in style components and optimize those away into a const under the hood. Hopefully this is fixed in a future version.
React doesn't do any "compiling". It simply takes the JS object tree that _you_ generated in your component's render function, and works from there. So yes, if you are declaring object literals in your render method, that will be a new object each time the component re-renders. If you know that a given style object is never going to change, you can hoist it out of your component's render method into the module scope…
https://babeljs.io/docs/plugins/transform-react-constant-ele...