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

TS2305: has no exported member when importing from a barrel file

$
0
0

I am using webpack and typescript in expo applicationI have 2 TS files then export functions for example:

// folder/file1.tsexport function func1() { ... };// folder/file2.tsexport function func2() { ... };

and I created a barrel index.ts:

// folder/index.tsexport * from "./file1";export * from "./file2";

Now, I wanted to use it in another TS file, simply importing those func1() and func2():

// different-folder/some-other-file.tsimport { func1, func2 } from "../folder";

But here I get the error:

TS2305: Module has no exported member 'func1'

and same for func2.

Do you have an idea how to solve this ?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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