Throughout the history of React there have been many ways to describe what it does that makes its programming model successful and for sure there are multiple aspects to it, but let's have a look into its foundation — components.
One of the most important characteristics for building large software is its maintainability and the most scalable mental framework for maintainability is the ability to delete and replace pieces of the system. So what makes React so special about code removal?
Props are the main way for a React component to receive information. It is its standard input interface. Props are pretty much the same to a React component as arguments are to a function, but with a small but important difference — components are automatically “subscribed” to the latest version of props and are getting executed automatically by React. …
I woke up today with a bunch of ideas about how a particular problem could be solved or at least what could be a better attempt than what I had so far because the problem is non-trivial and there is no standard well-known way to do it.
At the same time, I realized why it took me so long.
The problem I was thinking about was something I started to work on over a year ago. I did a prototype, settled on one particular implementation and then realized the problem is hard and doing it that way will result in too many problems later. This realization made me feel frustrated. …
Ok, I have spent some time by now with a Wear OS watch to get frustrated enough and make myself write a blog post which I really don’t like to do, but the status quo is so disappointing that I can’t keep it for myself.
I have a long history of using fitness trackers, starting with the very first jawbone up in 2012, then going over to Fitbit and finally Mi Band in recent years. …
Twitter is a platform where people tend to misunderstand intentions and nuances of a tweet, jump to a conclusion and escalate a debate in the wrong direction.
To avoid this, I wrote a set of hints which will hopefully help you understand me correctly and react in a better way.
It took us almost a year to release this version with much fewer features and improvements than originally planned, because most of the work happens in our spare time and current Open Collective status isn’t usable to pay contributors, not to mention myself.
The problem with HOCs besides of some level of indirection is also performance cost. In the end, a HOC needs to generate an additional component, which still needs to add up to React’s reconciliation work. Also, HOCs are not nice to look at in dev tools. …
Many people in both engineering and managing positions see pair programming as basically, two engineers working on one problem and spending twice as much time to solve it, even though one could do it alone. I thought the same myself until some time ago.
While in some cases this assumption might be true, in other cases pair programming will actually save you tons of money.
When a codebase is very complex, often the problem is not to actually fix a bug, but to do it in the right way, according to the current architecture and while taking legacy decisions into account. …
Recently I wrote a higher level overview of CSS-in-JS, mostly talking about the problems this approach is trying to solve. Library authors rarely invest time into describing the tradeoffs of their solution. Sometimes it’s because they are too biased, and sometimes they just don’t know how the users apply the tool. So this is an attempt to describe the tradeoffs I have seen so far. I think it is important to mention that I am the author of JSS, so I should be considered biased.
CSS-in-JS refers to a collection of ideas to solve complex problems with CSS. Since it is NOT a particular library, different libs might solve a different subset of problems and use different approaches, depending on their implementation details.
If you are interested in learning the tradeoffs of CSS-in-JS approach, I wrote a separate article for that.
Currently, DOM and Browser APIs seem to be using
null in some cases and
undefined in some others. While they had their historical reasons, the result of this inconsistency is that we have to rely on type coercion more often than we should be, which brings an entire set of problems.
What I would like to discuss though is what we would gain if we stop using
null and stick with
undefined in user code.
Is there really such a big difference in semantics? To me, both
undefined mean pretty much the same — an absence of a value. …
This topic is already well discussed and the intent of this article is to share how I prefer to use arrow functions in React and my view on PureComponent optimizations.
In function components, we have currently no other choice but to either pass the callback directly from the props to the child component or to create an inline arrow function. You may want the latter if you need to control the arguments passed to the original callback.
You need to be aware of 2 things in this example: