Never `import React from ‘react’` again, thanks to Webpack’s ProvidePlugin
JK Eldon
26619

I think it’s better to be explicit about all your imports.

It helps with code refactoring, linting, code completion in IDEs, and many other points.

Implicit imports are like global variables. They’re a code smell at best, and at worse a hidden technical debt that will only bite you when your project is sprawling and you have 20+ people on your team.

To be fair, I can see the allure for implicit imports if your codebase is structured around 1 React component per file, and React is essentially the only dependency of that file.

Yet even in this case, I would personally not use an implicit import since my IDE (PyCharm/Webstorm) can be setup to create files from a template that I define so I can place all my default imports into that template.

Show your support

Clapping shows how much you appreciated Kum Sackey’s story.