Skip to content
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

Question about namespace declarations #7

Open
batusai513 opened this issue May 25, 2019 · 3 comments
Open

Question about namespace declarations #7

batusai513 opened this issue May 25, 2019 · 3 comments

Comments

@batusai513
Copy link

Hi, I'am checking this repo for resources on how to estructure a TS project and I saw something interesting, https://github.com/piotrwitek/react-redux-typescript-realworld-app/blob/master/src/services/types.d.ts you are declaring all your types inside a namespace, I was trying to replicate this on my app created with create-react-app but I'm getting a module not found error, so I wanted to ask how do you make those namespace declarations import works in here.

Thanks

@michalpopek
Copy link

michalpopek commented Aug 25, 2019

That's a good question, I'm facing the same issue when trying to replicate this setup using the latest CRA ([email protected]). Any hints on how to fix that?

@piotrwitek
Copy link
Owner

You must be doing something differently, please check and use the same exact syntax.
Please do not try to change the structure or file extensions, keep everything the same. Only when you have it working you can experiment and change things one by one to find out where is the problem.

@senpl
Copy link

senpl commented Jan 23, 2020

I think the tricky part is that types are declared and exported in many places, not only in /services, but also in /store. So if they will be only in one place it will not work. It has to be in both.
This might be related: https://stackoverflow.com/questions/59864992/local-project-module-not-found/59867006#59867006 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants