Discover how React Native functions internally, and what it does for you without you knowing it.

Disclaimer: this articles assumes a (very) basic understanding of React Native and Native Modules. If you have never played around with them, I’d recommend getting a look at the official documentation first.

Edit: This article is based on a talk I’ve given in London for the ReactFest conference in March 2018. You can see me talk over here!

As I started using React Native, something quickly bugged me: what’s happening there? Indeed, from the standpoint of someone who simply uses React Native to build (great) applications, things can sometimes look magical. Want to make some native code usable from Javascript…

Where we learn about the React native bridge, and realize that React’s central event handling system often gets bypassed…

React native: it’s all about the bridge.

Following my last article regarding event handling in both React and React Native, I have had questions regarding how to emit custom events in React Native. Programming in React Native means you are no longer in the DOM, and tools like document.createEvent('myCustomEvent') are not available.

So, how do you manage to achieve a similar result?

Let’s figure that one out :-)

Why are events important in React native?

At its core, React Native is simply a Javascript-Java-Xcode translator. Nothing more, nothing less. …

You’re using it. You’re liking it. But did you know what React’s event handler is doing under the hood?

Stuff can sometimes get surprisingly messy if you don’t know how it works…

There are an awful lot of posts explaining how to use React’s event handling system, but not many that explain how it works. I have been working on React Native lately, and my struggles with event handling acted as a reminder of how important it was to understand precisely what’s going on. I thus decided to gather as much info as possible regarding event handling in React: the following is a report of what I found looking around the source code.

Let’s go!

Event handling in React: An overview

Conceptually speaking, event handling in React is nothing revolutionary. Its only goal is intercepting various events (clicks…

Nicolas Couvrat

Hi! I am a software engineer at Playstation, Japan. I mostly talk about backend stuff, golang and vim. I also like cooking. My views are my own.

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