links: React Native MOC


This guide helps to start creating the iOS side of Fabric Component

JS Spec

First, create the JS Spec in Flow/TypeScript. This Spec is picked up by Codegen and generates necessary cpp files that can be used for Type Safety on the Native Side

iOS

View Manager

The View Manager is responsible for exposing the iOS part of the component and its props to the JS side

Create a View Manager file MyComponentViewManager.mm

This file is mostly responsible for initialising the Native View

  1. Extend your interface with RCTViewManager
  2. Inside the implementation return a view and export necessary methods via RCT_EXPORT_VIEW_PROPERTY

View

This is responsible for initialising the view and updating the props.

The three important methods are

  1. componentDescriptorProvider
  2. initWithFrame
  3. updateProps
  4. ReactComponentViewProtocol class

tags: fabric react-native iOS