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

Offen
#518 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@RaphaelFakhri arbeitet bereits daran.

Seit 05.11.2026.

  • #519 von @RaphaelFakhri — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
react-native, swift, typescript
Bereich
build-system, mobile

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
553
Forks
58
Ø Merge
3 T. 18 Std.
Gemergte PRs (30 T.)
16

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus callstack/react-native-brownfield

Alle Issues in callstack/react-native-brownfield

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.