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

Ouverte
#518 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

@RaphaelFakhri y travaille déjà.

Depuis le 5/11/2026.

  • #519 par @RaphaelFakhri — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
react-native, swift, typescript
Domaine
build-system, mobile

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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 *.

Langage dominant
TypeScript
Étoiles
553
Forks
58
Merge moyen
3 j 18 h
PR mergées (30 j)
16

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de callstack/react-native-brownfield

Toutes les issues de callstack/react-native-brownfield

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.