navigation:codegen: optional number and boolean params break the iOS build

Abierto
#518 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@RaphaelFakhri ya está trabajando en esto.

Desde el 5/11/2026.

  • #519 de @RaphaelFakhri — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
react-native, swift, typescript

Línea de trabajo

Start with brownfield.navigation.ts and the navigation:codegen generator, then inspect the generated Swift protocol and Objective-C implementation alongside the React Native TurboModule spec. Reproduce with the optional number and boolean parameters shown in the issue and build the iOS app. Done when the generated iOS code compiles and represents both optional parameters as nullable NSNumber * values.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The docs state that optional params are supported in brownfield.navigation.ts. For optional number and boolean params, brownfield navigation:codegen generates a Swift delegate that doesn't compile.

Steps to reproduce

  1. Add a method with optional primitive params to brownfield.navigation.ts:

    export interface BrownfieldNavigationSpec {
      openFeed(page?: number, animated?: boolean): void;
    }
    
  2. Run npx brownfield navigation:codegen.

  3. Build the iOS app.

Expected behavior

The generated code compiles, and the params are nullable on iOS, as NSNumber * in the React Native TurboModule spec.

Actual behavior

The generated Swift protocol contains:

@objc func openFeed(_ page: Double?, animated animated: Bool?)

Swift reports "Method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C". The Objective-C implementation declares (double)page and (BOOL)animated, while React Native codegen declares both params as NSNumber *.

Lenguaje dominante
TypeScript
Estrellas
553
Forks
58
Merge medio
3 d 18 h
PR fusionados (30 d)
16

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de callstack/react-native-brownfield

Todos los issues de callstack/react-native-brownfield

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.