Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I want to import two objects from different files based on some conditions, and export the imported object with different name:
if(condition1) import {obj3, obj4} from './file1'; else import {obj5, obj6} from './file2'; export {obj1, obj2}
export default __DEV__ ? App : Sentry.wrap(App)
You could have an intermediate importer/exporter that re-export a given import based on a condition, like this:
//exportSelector.js; import {obj1, obj2} let exportedObj = condition1 ? obj1 : obj2; export exportedObj; //import.js import exportedObj;
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
export default __DEV__ ? App : Sentry.wrap(App)