You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading my React Native project, I've encountered an issue where relative imports no longer work, while absolute imports function as expected. This problem affects various modules, including components and utilities within the src directory.
Steps to reproduce
This is my structure for dialog
src/components/dialogs/index.ts
index.ts imports all the different dialogs and export them, so that other components can use them.
**index.ts**
import MyDialog from 'src/components/dialogs/myDialog/MyDialog';
export {
MyDialog
}
src/components/index.ts
index.ts imports all the dialogs, inputs, buttons and etc then exports them
**index.ts**
import MyDialog from './dialogs';
export {
MyDialog, ---> This doesn't work if I import like this
OtherDialogs...
}
import MyDialog from 'src/components/dialogs/myDialog/MyDialog'; ---> This works
I have no clue why it started braking after the upgrade.
In my case, the file being imported has an folder with the same name in the same level of file hierarchy, and this is causing the problem after RN update (I don't know the exact agent causing this).
Description
After upgrading my React Native project, I've encountered an issue where relative imports no longer work, while absolute imports function as expected. This problem affects various modules, including components and utilities within the src directory.
Steps to reproduce
This is my structure for dialog
src/components/dialogs/index.ts
index.ts imports all the different dialogs and export them, so that other components can use them.
src/components/index.ts
index.ts imports all the dialogs, inputs, buttons and etc then exports them
I have no clue why it started braking after the upgrade.
This is babel.config.js
This is tsconfig.json
React Native Version
0.76.3
Affected Platforms
Runtime - iOS
Areas
Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
I couldn't push on the repo https://github.com/ciplnaveen/react-native-import
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: