infinitered / ignite

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!
MIT License
17.58k stars 1.39k forks source link

Screen generator template generating the wrong ScreenProps interface #2455

Closed theabhishek2511 closed 1 year ago

theabhishek2511 commented 1 year ago

Describe the bug

The screen generator template seems to be generating the wrong ScreenProps interface.

Currently it generates a NativeStackScreenProps<AppStackScreenProps<T>>. This evaluates to NativeStackScreenProps<NativeStackScreenProps<AppStackParamList, T>>, which causes TypeScript to throw all sorts of tantrums no matter what route names I pass.

Looking through in discussions and following #2383, changing the generated ScreenProps interface to AppStackScreenProps<T> fixes the problem.

Ignite version

8.8.2

Additional info

System
  platform           win32       
  arch               x64         
  cpu                4 cores      Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz
  directory          eHealth      D:\ReactProjects\eHealth

JavaScript (and globally-installed packages)
  node                 16.18.0      C:\Program Files\nodejs\node.EXE
  npm                  8.19.2       C:\Program Files\nodejs\npm.CMD
    @ionic/cli         6.20.6      
    cordova-res        0.15.4      
    cordova            11.0.0      
    native-run         1.7.1       
    react-devtools     4.27.1      
    react-native-cli   2.0.1       
    yarn               1.22.19     
  yarn                 1.22.19      C:\Users\Administrator\AppData\Roaming\npm\yarn.CMD
    react-devtools     4.27.1      
  pnpm                 -            not installed
  expo                 48.0.19      managed

Ignite
  ignite-cli         8.8.2        C:\Users\Administrator\AppData\Local\npm-cache\_npx\e31027f3785124a8\node_modules\.bin\ignite.CMD
  ignite src         build        C:\Users\Administrator\AppData\Local\npm-cache\_npx\e31027f3785124a8\node_modules\ignite-cli\build

Android
  java               11.0.16.1    C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin\java.EXE
  android home       -            C:\Users\Administrator\AppData\Local\Android\Sdk

Tools
  git                git version 2.39.0.windows.1   C:\Program Files\Git\cmd\git.EXE 
frankcalise commented 1 year ago

@theabhishek2511 thanks for the bug report! Would you be able to contribute a PR perhaps?

theabhishek2511 commented 1 year ago

@frankcalise I have created a PR (#2458) but the CI seems to be failing. I'm fairly new to RN (and ts in general) so I can't tell what's causing this. Could you please have a look?

frankcalise commented 1 year ago

Merged, thanks for the contribution!