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

How to declare an import name the same as declared in another constants/variables file

$
0
0

I have two files, routes.js and package.tsI want to declare an import name in package.ts by using variable declared in routes.js

This is routes.js

//object for the whole app routesexport default Object.freeze({  packageModule: "PackageModule",  complaintModule: "ComplaintModule",  login: "Login",});

Now i want to declare like this in package.ts -

import routes from "../../navigation/routes";import routes.packageModule from './SearchPackage';export { routes.packageModule };

How to handle this properly? This is because i want to have a common place to manage all my imports in react native.


Viewing all articles
Browse latest Browse all 6295

Trending Articles



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