My Blog at Learn.co


The future is in the cloud

Managing state immutably in React

Updating components in React happens in two different ways – externally via props passed down from the component’s parent component, and internally by manipulating the state of the component itself. In external manipulation props can in fact be not only passed down from the parent, but also mapped from the state of the application or from dispatch when using Redux, but the actual component receiving the props remains passive in the sense that it doesn’t participate in the initiation of the manipulation. Manipulating the state of the component is a different thing – here the initiative of the manipulation originates in the component itself.


Inline styling with Radium and StyleRoot in React

Like plenty of other things in React, styling can be implemented in a number of different ways. The most conventional way of declaring and using CSS styles, and not just in React, is to simply create separate .css files and use CSS selectors. This way e.g. a class can be given the same style across the entire application, which may be a good thing as long as the application is not too large and still easy to control. There is, however, a considerably more flexible and powerful way to inline style individual elements of our components right inside the component itself without using separate .css files at all. Not only inline styling does allow us to avoid conflicts between specific classes in different components, it also gives us more freedom to style a component without inadvertently altering styles in other components and even eliminates a lot of potentially unnecessary .css files in our application.


Conditional rendering in React

One of the great things about React is the fact that the simplicity of its syntax opens a number of options on what logic to use, as well as where and how. Since everything we type into a React component, stateless or stateful, is essentially JavaScript, the variety of options of implementation of various functionalities is as broad as the variety of ways things can be written in JavaScript. This variety is in fact so broad that it is even considered one of the drawbacks of React, which is so unopinionated that a developer can end up with too much choice.


React Router: how exact is the exact path?

The mindset of having and running all applications locally on a device, stationary or mobile, has been already for quite some time shifting towards a completely different, cloud based approach. As applications move from local devices to the cloud and essentially become websites, a user interface, who’s speed and reliability in a local application are taken for granted, becomes perhaps the most important part of the context of the cloud based approach, especially in applications dealing with large amounts of data.


Swapping every two adjacent elements in a linked list

Although linked lists are not necessarily taught immediately among the fundamentals of JavaScript, it is quite an important dynamic data structure where each node contains some data and a reference to the next node. There is a lot of argument going on about the necessity of linked lists in web development or even in JavaScript in general, since we already have arrays; what is not arguable though is the fact that any developer can encounter linked lists in a technical interview. In my case the task of writing a function that swaps every two adjacent nodes in a singly linked list in JavaScript was given to me as homework.