Suppose you have a Javascript variable containing multiple lines of text that you want to render in your React component. More or less you would have the following code:

const text = `This is a long string of text and it
includes new line characters. We want this text
to display properly using React.

function App() {
return (

If you try to run this example you will easily notice that, despite the text being on multiple lines, the output is displayed on one single line:

This is a long string of text and it includes…

Una semplice guida per procurarsi i documenti necessari per entrare in Canada: quando serve il visto turistico, quando invece è sufficiente l’Electronic Travel Authorization e come ottenerlo.

Photo by Jonathan Denney on Unsplash

Se siete diretti in Canada per trascorrere la vostra vacanza avete bisogno di alcuni documenti che vi consentiranno di passare i controlli doganali e quindi di entrare in Canada. Ovviamente uno di questi è il passaporto, il quale deve essere valido per la durata del soggiorno e scadere almeno 6 mesi dopo il vostro arrivo sul territorio canadese.

Oltre a questo avrete bisogno di un permesso, che varia a seconda della motivazione della vostra visita. Esistono principalmente due tipologie di permesso, il classico visto temporaneo, o Temporary Resident Visa, e l’Electronic Travel Authorization, detta anche eTA.

I due permessi non…

My app had no bad symptoms, who knew that it was hiding a secret issue? In this post I show you how I dug into the running application and why you should use the same process to look for issues in your app.

CPU profiling with Chrome Devtools

A little truth that not everybody knows is that you’re unlikely to know what happens in your application until you actually look at your application while it is running. It doesn’t matter if you are the developer that wrote most of the application code, todays applications might be so complex that what happens behind the scene is hard to picture.

A story that supports this statements happened a week ago, when I started looking into the code that performs the server side rendering of an application. “It’s straightforward and it works fine” I thought, “after all it’s less than one…

I struggled for some time around the end-to-end testing setup in my React-Redux app. I came out with some ideas and a workflow that I would like to share. Here is how it works.

As developers we only have one way to be certain that our code works, we test it. Since it’s very likely that we will make mistakes, testing comes in our help to ensure that we do not end up pushing a broken application in the hand of our users.

Thousands of blog posts has been written around unit testing React components, Redux reducers, action creators or sagas. But when I started documenting myself around automated end-to-end testing I couldn’t find a solution used by most of the people in the React community. …

More than one year ago we started a new project: a universal SPA based on React and Redux. One of the first choices to make was: “how do we handle stylesheets?”. We gave a chance to JSS. 60+ components later, it has been the best experience we had with stylesheets so far. Here are some technical solutions we adopted and the overall feedback.

I was initially skeptic about the CSS-in-JS solutions that were recently gaining popularity. Probably I was overestimating the benefits of working with a toolset that I already knew, SASS, compared to the many benefits JSS brings to a React project. Anyway, after some internal team discussions, we decided to give JSS and its React integration (react-jss) a chance.

At the beginning not everything was straightforward: here is how we managed to solve some of the problems we discovered.

I decided to leave Medium and move my articles to my personal blog.

You can read the rest of this article here.

Clojurescript is a compiler for Clojure that targets Javascript. Using Clojurescript you can write your Javascript app in Clojure, taking advantage from functional programming paradigms, for example immutable data structures, on top of the excellent Google Closure Tools library that powers many Google products.

I decided to leave Medium and move my articles to my personal blog.

You can read the rest of this article here.

In every object oriented programming language we model the domain with classes. Every object we generate from our classes is a container of state, represented by your instance variables, and behavior, represented by your methods. But Elixir is a functional programming language therefore it doesn’t have classes. It also doesn’t allow you to store state in objects. But of course it allows the definition of behavior, using functions.

I decided to leave Medium and move my articles to my personal blog.

You can read the rest of this article here.

If you come from object-oriented programming, one of the weird things about Elixir and other functional programming languages is for sure immutability.

In many of those, we are allowed to assign a value to a variable and then change it during the execution of a program.

I decided to leave Medium and move my articles to my personal blog.

You can read the rest of this article here.

Dario Ghilardi

Passionate software engineer, trail runner, traveler. Insanely affected by lifelong learning. @darioghilardi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store