Updated

My First Open Source Contribution

React Native Elements website header

Last night, in the wake of all the hype about ChatGPT and the growing capabilities of AI and machine learning, I had a great idea for a mobile app that would be a lot of fun. Essentially this would be an app where you, as the user, provide a prompt - some type of subject, topic, or anything really - and the app would return a cocktail recipe based on that prompt.

The idea has me really excited - and yeah I could implement the functionality in a web application fairly quickly - but I really feel that this one would be better served as a Mobile App. So I set out to learn React Native.

As I was following some of a React Native tutorial today, they introduced the use of React Native Elements - a very popular UI library for the platform. This was interesting for me because I actually have a contribution to React Native Elements.

Back in spring of last year, I set out to make my first open source contribution. I learned to search for "good first issue" on Github, and used that to look through the issues from various repositories. One that caught my eye was for React Native Elements. I was not at all familiar with React Native / Expo at the time, but I was familiar with React. So I started investigating the issue. A user of the library was attempting to conditionally render TabView items in their app, but it was not functioning as expected.

I traced the issue to a misuse of React.Children functions, and I went in and made the quick fix. However, it was anything but easy.

First, I had to set up the project. I following all the steps in the project readme to clone the repo and install dependencies, made the fixes, set up Expo to test them and verify the fix, write some tests to verify tabs could now be conditionally rendered, and then struggled to get past the Typescript commit hooks (some kind of version mismatch). Even after all that was done, it turns out additional fixes had been made to the same component and so I had to deal with a merge conflict before my PR could be accepted.

I did it though - I have written a piece of code in a very popular library. I learned a lot about how to contribute to open source - and while I'm more familiar with the process now, it was challenging for me at the time.

The Accepted PR