Sometimes, we want to reexport a class in TypeScript.
In this article, we’ll look at how to reexport a class in TypeScript.
How to reexport a class in TypeScript?
To reexport a class in TypeScript, we can use the export
keyword.
To export a class that’s a member of another module, we write
export { A } from "a";
where A
is the class that we want to export from module a
.
To export a class that’s a default export, we write
export { default } from "d";
to export default
instead of the class name.
Conclusion
To reexport a class in TypeScript, we can use the export
keyword.