Reexporting from Another Module
Learn how named and default exports are reexported with the help of examples.
We'll cover the following...
Why should we re-export modules
You can re-export modules to reduce the number of imports and make dependencies transitive. Occasionally, you may want to make some references that are contained in other modules available to the users of your module.
Example
For example, let’s say we create a weather
module but we want to expose functions from the temperature
module we created previously and also another hypothetical pressure
module.
The weather
module, itself, may expose some references that it contains. Now, suppose a module wants to use the references in the weather
, temperature
, and pressure
...
Access this course and 1400+ top-rated courses and projects.