software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.01k stars 510 forks source link

Incorrect native-stack types in 2.17.0 #789

Closed hehex9 closed 3 years ago

hehex9 commented 3 years ago

Description

type files are published in the wrong place in v2.17.0

node_modules/react-native-screens/lib/typescript
├── TestsExample
│   └── src
│       └── Test748.d.ts
└── src
    └── native-stack
        ├── index.d.ts
        ├── navigators
        │   └── createNativeStackNavigator.d.ts
        ├── types.d.ts
        └── views
            ├── FontProcessor.d.ts
            ├── FontProcessor.expo.d.ts
            ├── HeaderConfig.d.ts
            └── NativeStackView.d.ts

notice the nested src and TestsExample which is not match what native-stack/package.json needs

{
  "types": "../lib/typescript/index.d.ts"
}

Expected behavior

works

Actual behavior

import {createNativeStackNavigator} from 'react-native-screens/native-stack'
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/shared/navigation.ts:4:8 - error TS7016: Could not find a declaration file for module 'react-native-screens/native-stack'. '/Code/rntest/node_modules/react-native-screens/lib/commonjs/native-stack/index.js' implicitly has an 'any' type.

Snack or minimal code example

import {createNativeStackNavigator} from 'react-native-screens/native-stack'

Package versions

mhammerc commented 3 years ago

Same here 😋

BTW thank you for your great work on this package, keep going!

WoLewicki commented 3 years ago

Can you check if it is fixed in 2.17.1?

mhammerc commented 3 years ago

It's working for me!

hehex9 commented 3 years ago

thanks! it's working now