Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Pattern 'components/*/*' can have at most one '*' character

$
0
0

I am working on a React Native application with Expo, and I am using some template components from 3rd party.In my src directory, I have an "app" folder that holds my components to use.This is the app folder structure

And this is the whole folder structure

Almost every component is also structured in this way:Example of Button component

My tsconfig.json file is giving me problems, since I needed to change some paths as well:

{"compilerOptions": {"allowSyntheticDefaultImports": true,"jsx": "react-native","lib": ["dom", "esnext"],"moduleResolution": "node","noEmit": true,"skipLibCheck": true,"resolveJsonModule": true,"strict": true,"noImplicitAny": false,"baseUrl": "./","paths": {"components/*": ["./app/components"],"components/*/*": ["./app/components/*/index"],"services/*": ["./app/services"],"app/*": ["./app"],"navigation/*": ["./app/navigation"],"theme/*": ["./app/theme/*"]        }    }}

And it's complaining about that

Pattern 'components/*/*' can have at most one '*' character.

When I try to import a Button component into my page Register.tsx, this is what React native is complaining about:

Unable to resolve "components/atoms/text" from "app/components/atoms/button/index.js"

I am trying every solution to fix this but it doesn't work. I tried to manually change every import but this is not an option that could work, is extremely time consuming and it won't make any sense.

Any suggestion to fix this issue?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>