React
Patching 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 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 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