valdi-migrate

Convert Flutter, React, and Jetpack Compose components into Valdi TypeScript components.

16.4k|541|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/Snapchat/Valdi --skill valdi-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: valdi-migrate
Source: https://github.com/Snapchat/Valdi/tree/main/ai-skills/skills/valdi-migrate
Command: npx skills add https://github.com/Snapchat/Valdi --skill valdi-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating UI code from Flutter, React, or Jetpack Compose to Valdi is error-prone because Valdi has no hooks, no functional components, no Compose modifiers, and a void-returning onRender method. This Skill prevents invalid patterns and maps framework-specific APIs to correct Valdi equivalents.

Core Features & Use Cases

  • Anti-pattern detection: Flags React hooks, Compose remember/Modifier chains, inline JSX lambdas, map() in render, and other patterns that do not exist in Valdi.
  • API mapping tables: Provides lifecycle, component, navigation, state, storage, and networking mappings from Flutter, Compose, and React to Valdi equivalents like StatefulComponent, navigationController, PersistentStore, and HTTPClient.
  • Correct code templates: Supplies working examples for stateless and stateful components, list rendering with forEach, module-level Style creation, and the provider pattern replacing React Context.
  • Use Case: A developer porting a React screen with useState, useEffect, and a FlatList receives a Valdi StatefulComponent using onCreate, setState, class arrow handlers, and a scroll element with forEach.

Quick Start

Convert this React component with useState and a FlatList into an equivalent Valdi StatefulComponent.

Frequently Asked Questions about valdi-migrate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a React component to Valdi?

Convert function components to classes extending Component or StatefulComponent, replace useState with a state field and this.setState, and move useEffect logic into onCreate, onDestroy, or onViewModelUpdate. Replace this.props with this.viewModel and render lists with forEach instead of map.

How do I convert Flutter widgets to Valdi components?

Map StatelessWidget to a class extending Component and StatefulWidget to StatefulComponent with a typed state object. Replace build() with a void onRender(), initState with onCreate, dispose with onDestroy, and Navigator.push with navigationController.push.

Does Valdi support React hooks like useState or useEffect?

No, Valdi has no hooks and no functional components. State lives in a StatefulComponent state field updated via this.setState, and side effects run in lifecycle methods onCreate, onDestroy, and onViewModelUpdate.

What replaces Jetpack Compose Modifier and remember in Valdi?

Valdi has no Modifier chain or remember API. Layout and styling attributes like padding, flexDirection, and gap are set directly as element attributes, and state is held in StatefulComponent fields rather than mutableStateOf.

Why does map() not work when rendering lists in Valdi?

Valdi JSX is a side-effect statement, not a returned value, so map() results are discarded. Use forEach inside onRender to emit child elements, and assign a key attribute to each repeated child.

What replaces React Context or Flutter Provider in Valdi?

Use createProviderComponentWithKeyName to define a provider, render it at the root with a value, and wrap consumers with the withProviders higher-order component. Consumers read values from this.viewModel.providersValues.