React Native
Turn a Callback Function into a Promise in Objective-C and Java
I have been working on a React Native wrapper library for the Zendesk Support SDK. The SDK uses functions that accept a callback to upload a file. I wanted to upload an array of files and when all of the files were open, I wanted to call another function to create the Zendesk ticket. I…
Read MorePatching npm Modules
Sometimes it is helpful to patch an npm module. It could be the case that you need to make a simple fix and you don’t want to maintain a fork of the library. The library may have a pull request to fix the issue but you don’t want to use an unmerged branch. For those…
Read MoreBreaking Change with setState in React 16 Alpha Affecting React Native 43+
Recently, I upgraded the React Native app at Build.com to version 45.1. While testing the app, we discovered an undocumented change to the way that setState works. This change will affect React Native version 43+ and is due to a change in the React 16 alpha library. In this post, I’ll describe this breaking change…
Read MoreReact Native 45 Errors in Jest
At Build.com, a co-worker and I are in the process of updating our app to the most recent version of React Native, 0.45.1. We’re currently working to fix up our tests in Jest and I thought I’d share with you some issues that we’ve discovered.
Read MoreCreating Your First npm Package
Creating Your First npm Package Lately, I’ve been pushing myself to contribute more to open source. I started by contributing to existing projects: small features and writing documentation. I even wrote a blog post about it. This past week, I was finally able to make the jump from contributing to a project to authoring one.…
Read MoreFrom Ski Instructor to Programmer – My Journey Back to Programming
On the surface, I have a stereotypical story for a programmer: I started programming at a young age, went to college for computer science and now I’m a senior JavaScript developer. But for around 8 years, I didn’t program at all and didn’t work in a technical field. This is the story of how I…
Read MoreFixing the React Native Error: “Unable to open URL: telprompt”
At Build.com, we use Bugsnag to help monitor our app for crashes and errors. The other day, I noticed a group of errors that all took the form: Error: Unable to open URL: telprompt:5551231234 After some research, I figured out what was causing the bug and how to fix it.
Read MoreFixing the Jest Error, “Invariant Violation: addComponentAsRefTo”
I work on the Build.com React Native app. We’re currently on a push to dramatically increase our test coverage. Recently, I came across a bug that affects some, but not all, of our tests. Tests fail with the message: Invariant Violation: addComponentAsRefTo(…): Only a ReactOwner can have refs. You might be adding a ref to…
Read MoreAdding Support for ES2015 Number Methods to iOS 8
At Build.com, I’m working on an e-commerce app using React Native. React Native allows us to write apps in JavaScript that can run on iOS and Android phones with near native performance. The other day, we received several crash reports from users running iOS 8. All of the reports involved method calls on JavaScript’s global…
Read MoreHandling the “possible EventEmitter memory leak detected” Error in React Native
The project that I’m working on is an e-commerce app for an online retailer, Build.com, built using React Native. React Native is a JavaScript framework that allows you to build cross-platform mobile apps in JavaScript that have near-native performance. While we use Redux to handle the state of our app and its data, occasionally we…
Read More