Skip to main content

Intro

In this guide, you'll learn how to:

  • emit events from a native module to the JS code
  • subscribe a native module to the events provided by the OS
  • export constants from a native module to the JS code

Difficulty

May sound difficult, but you'll manage it 🫡

Task

As a user, I want to detect when my device is in landscape or portrait orientation.

What's the plan?

  • create module's boilerplate
  • creating JS spec
  • iOS implementation
  • Android implementation
  • using the module in action

Result?

Screen Orientation module portrait resultScreen Orientation module landscape result

Can't wait? Let's set up module boilerplate.