Over a year ago I wrote an article about a kind of hacky way to use react-native-firebase in Expo app. But things have changed significantly since then. In this article, I’m going to show you the new, much easier way to do this.
This is also a getting started guide for new features that Expo has released recently.

TL;DR Scroll down, there’s a tutorial down below. 😉

It was Expo SDK 36’s when I was trying to integrate native Firebase with an Expo app. It was a tough time because Expo barely supported custom native code. That is — I…


Kotlin is an awesome language, but its “syntax sugar” can sometimes be confusing. Although this particular thing is mentioned in the documentation, it’s easy to miss. Let’s start with an example:

We have a class AspectRatioScreen with one property, which defaults to old good 4:3. Then we have ResolutionScreen with width and height properties. Their setters automatically update the aspect ratio.

In main we create a ResolutionScreen object and print its parameters. By default, the resolution is set to 1920x1080 which corresponds to 16:9 aspect ratio. But the program output is:

Screen resolution: 1920x1080, ratio: 4/3

The aspect ratio doesn’t…


When writing applications in Node, you often need to write or read the contents of a file. Node.js provides a fs library dedicated to this purpose. But how do we deal with the filesystem when testing our code?

I’m going to present two approaches to this problem – by mocking individual filesystem methods and by using virtual file in-memory file system. I’m also going to explain why the latter is a much better choice than the former.

Mocking individual methods

The simplest solution is to directly mock individual methods of the fs module. Let’s assume we have a method that reads the first…


When you are making a LED project, you often need to control it using PWM. For RGB projects you need at least 3 PWM channels. If you wanted to control 10 individual RGBs, you need 30 PWM channels, unless you use external driver IC or digital LEDs like WS2812.
Most AVR microcontrollers don’t have that many hardware PWM channels. You can do software PWM emulation, but it costs precious CPU time (unless it has nothing other to do), so we’d like to stay with hardware solutions.

Microcontrollers from XMEGA family are called “Atmega on steroids”, because they are like normal…


Raspberry Pi 4B has one well known issue — it doesn’t power up when plugged using some USB-C cables. It may work with old USB-C to USB 2.0 cable, but, for instance, with original MacBook charger it doesn’t. In general, it won’t work with electrically marked (e-marked) cables, but works well with ‘dumb’ cables.

This issue has recently been fixed in revision 1.2 of Raspberry board, however you can still come across older hardware versions. To check your board revision, see this page.

It turns out, that RPi board does not follow the USB-C electrical specification. In brief, USB-C has…


I got used to using Expo. It has many useful and ready to use libraries and an awesome Client app. Recently I’ve been working on React Native app, which used Firebase Cloud Firestore as the main database.

Update 07/2021: This article has become outdated and the solution described . I’ve written a new article describing a lot better approach to this problem. You can find it here. 🔥

The content below is outdated, I strongly discourage you from using the solutions described there. For a better solution, please see the update above.

When using Expo with managed workflow…

Bartłomiej Klocek

Enthusiast of electronics and all kinds of software development — from web apps to embedded systems. Expo open-source contributor at Software Mansion.

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