-
-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: typescript paths #2182
fix: typescript paths #2182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure it works now 😅 Please test by running yarn prepare
, runnning apps, looking for errors in code editor (we don't want "red" back.
Let me know ☝🏻 how does it look
@kkafar Now the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is how this should work, because inside our native stack implementation (v5) we still use old types from react-navigation
v5, thus it does not make sense to use types from our submodule. The goal of the submodule is to have easy time modifying v6 / v7 native stack code within our examples.
The changes look fine, make sure this works fine with code editors & our example do work just fine and we're good to go.
## Description This PR fixes the errors showing on `yarn prepare` command. Turned out that custom path definition to react-navigation folder produced typescript errors when running the command. The default node_modules directory contains typescript definitions that do not cause any problems. ~~Some of the react-navigation packages were missing in node modules and the ts support was missing in examples so I added them as devDependencies - now there are no errors during the prepare command and there is full TS support in common examples directory.~~ ~~The alternative approach would be to define compilerOptions paths pointing to react-navigation folder inside examples and test-examples tsconfigs individually instead of adding new devDependencies~~ Edit: decided to go with the second approach as it does not add any extra dependencies - the tsconfigs inside common example directories redefine paths. ## Changes - removed custom paths to react-navigation types (node_modules is the default) - added the paths to react-navigation types individually in apps/examples and apps/test-examples <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> ## Test code and steps to reproduce <!-- Please include code that can be used to test this change and short description how this example should work. This snippet should be as minimal as possible and ready to be pasted into editor (don't exclude exports or remove "not important" parts of reproduction example) --> ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
Description
This PR fixes the errors showing on
yarn prepare
command. Turned out that custom path definition to react-navigation folder produced typescript errors when running the command. The default node_modules directory contains typescript definitions that do not cause any problems.Some of the react-navigation packages were missing in node modules and the ts support was missing in examples so I added them as devDependencies - now there are no errors during the prepare command and there is full TS support in common examples directory.The alternative approach would be to define compilerOptions paths pointing to react-navigation folder inside examples and test-examples tsconfigs individually instead of adding new devDependenciesEdit: decided to go with the second approach as it does not add any extra dependencies - the tsconfigs inside common example directories redefine paths.
Changes
Test code and steps to reproduce
Checklist