Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to find out module import instructions when not in the docs?

Often in documentation for libraries, information will be given in the docs about how to import the module once it’s been installed via npm. For example:

import React from "react" 

When this isn’t given, how is it possible to know what should be imported to make use of the library?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

For default imports (like the one you showed) you can choose any name you like.

For named exports you’re going to have to dig into the source code to see which named exports exist. If a package doesn’t even provide documentation on that, I wouldn’t consider using it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading