Is there a way to import all components?
See original GitHub issueI would like to do:
import * as MaterialUI from "material-ui";
To have all components accessible as properties on the MaterialUI
object. Is there a way to do this or something similar?
Right now when I do that I just get an object with a colors
property.
- I have searched the issues of this repository and believe that this is not a duplicate.
Context
I am trying to create async wrappers for each component inside of my build system.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How to import all components in React? - Stack Overflow
js file, import // the components you exported just the way you did it import NavBar from './NavBar'; import SideBar from './SideBar'; export...
Read more >Import Components in React Like a Pro - The Startup - Medium
Hello Everyone! Today I'll show you how to import components in an efficient way. This will make your code more readable and concise....
Read more >Importing and Exporting Components - React Docs
What a root component file is; How to import and export a component; When to use default ... Exporting and importing multiple components...
Read more >Import All Components - Material Design for Bootstrap
Recommended way of optimization is to use modules. Importing anything from the compiled js file or even just the file causes all ui...
Read more >Ad by Adclickersbot - Quora
Simplest way would be to import them all exactly like you suggested: import Blah1 from './components/Blah1.js';. import Blah2 from ' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My bad, they are already enumerable: https://github.com/mui-org/material-ui/blob/caf5513c6f19d1b776801c96d1715b1dd1a6d1b0/src/index.spec.js#L11-L21
@ryanpcmcquen The uppercasing can be as good filter. You can prune all the lowercase modules. They will never be react components. But you can get some classes that aren’t component with an uppercase.