Is it ok/good practice to register all components globally?
Reason
- to avoid doing of imports of components manually when other components needed them.
- a bit annoyed seeing component with lots of import when the app gets bigger.
Are there any downside of this?
1 Answer
You generally shouldn't register a component globally if you aren't going to use it frequently throughout your application. Quoting the docs ...
1Global registration often isn’t ideal. For example, if you’re using a build system like Webpack, globally registering all components means that even if you stop using a component, it could still be included in your final build. This unnecessarily increases the amount of JavaScript your users have to download.