Avoiding issues with Promises in your Cypress E2E tests

Using Cypress.Promise for consistency across Chrome and the Electron browser.

Tidy SQLite statements with JS Template Literals

While reviewing an open source React Native project I’d worked on recently, I was surprised with how difficult I found parsing the SQLite statements that I’d written in JavaScript. It seemed that my best efforts of breaking a long statement into multiple lines had added a number of characters which negatively affected the human readability of the code. Take the following CREATE TABLE statement as an example:

Using SQLite Dates in a React Native app

When I first began working with SQLite I was surprised to learn that there was no DATE or DATETIME datatype equivalent. Instead, time-based data must be stored as INTEGER, TEXT or REAL types. But, how can you logically order a TEXT-based date? How can you move seamlessly between Moment.js on the clientside and these primitive types in SQLite? Read on!

Building a responsive table in React Native with Hooks

This post details a technique that you can use in a dual orientation app to render more (or less) data in your tables–as space permits—using a couple of simple hooks. Keeping in mind that the last thing our app users want is to be unable to access the data they’re looking for, we’ll provide a hint showing how they can rotate their device to reveal even more.