Replies: 4 comments
-
I have the same issue, I added the |
Beta Was this translation helpful? Give feedback.
-
What does the My App can still run even I remove that line. Really dislike the framework implicitly do something for me. |
Beta Was this translation helpful? Give feedback.
-
When you add a route module, typings related to it will be generated in an 'isomorphic' directory Eslint seems not be able to solve this kind of 'import' for now, or it will when you configure the 'import/resolver' properly but I haven't tried yet. Adding |
Beta Was this translation helpful? Give feedback.
-
I've had this problem lingering ever since I upgraded to RR7 and I still can't figure it out. I followed the docs closely during migration, but they don't mention anything about eslint, which seems to be the problem here. I thought maybe I was having problems because my folder structure is probably unique relative to most RR projects. I put my route files inside of semantic "module" folders: e.g. a) the import is actually resolved. I can access my route types via the import just fine. Eslint just thinks it isn't, and
Which let's me do something like: So, I'm sure it's something to do with eslint, but I'm not sure what config is needed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In my project, I enforce
inline-import
for types. My eslint rules are likeWith these rules, inline type imports like this are allowed:
But top-level type imports are not:
However, when importing
Route
in React Router v7, there seems to be issues resolving paths when using inline type imports. For example:The error disappears if I use a top-level type import:
I want to maintain inline type imports across my project while resolving this issue. I could disable the rules or allow top-level imports, but I prefer to keep the rules consistent.
In the docs, it is mentioned as top level import so I was curious if anyone else faced this issue and there is a good workaround.
Beta Was this translation helpful? Give feedback.
All reactions