Migration

Plan the migration

Choose a first slice and list the behaviors and dependencies you will verify before switching.

On this page

Choose the first screen#

A good first screen has most of these traits:

  • Few exits. It is opened from one or two places and leaves through one or two. Each exit is an event to wire.
  • Its own data. It does not depend on a deep tree of React context or on state shared with neighbouring screens.
  • A lot of logic you would like to share. Validation, formatting, parsing or rules that you also need on a server or on another platform are the best candidates: that code can move to commonMain without a UI.
  • Visible, but not critical. Pick something users notice but where a bug does not stop a purchase or a login.
  • Few native dependencies. A screen built around a native module you have not ported yet is a poor start. Before choosing the screen, check library alternatives for the dependencies it uses.

Avoid starting with the root navigator, an authentication flow or a screen that every other screen reads from. They touch everything, so they are cheaper once the leaves are done.

The smallest useful slice is not always a whole screen. A single function can move first: a @ReactNativeFunction that your TypeScript calls looks like any other function, and it proves the toolchain in your app before a UI is involved.

List the behaviours to preserve#

Before the first line of Kotlin, write what the screen does today. Use the list as a review checklist for the new version, and for QA.

Area Questions to answer
Inputs Which props, route params and query strings does it read? Which are optional?
Outputs Which callbacks does it call, which routes does it open, what does it return to the previous screen?
States Loading, empty, error, offline, partial data. What does each look like?
Interactions Gestures, scrolling, keyboard handling, pull to refresh, haptics.
System Back button, safe areas, status bar, orientation, dark mode, text scaling.
Accessibility Labels, focus order, announcements, large text.
Analytics Events and properties the product team relies on.
Entry points Deep links, push notifications and universal links that open it.

The inputs and outputs rows become the props and events of the Compose component, so they are worth getting right: they are the contract between the React Native side and the Kotlin side.

Use the inventory to decide whether to start with business logic, a component or a screen.