Styling React Components Flashcards
1
Q
What are the 4 approaches to combine CSS and React?
A
Inline Styling;
CSS-in-JS Libs;
CSS StyleSheets;
CSS modules;
2
Q
What are the 7 common problems of styling with vanilla CSS?
A
1 - Global namespace; 2 - dependencies; 3 - dead code elimination; 4- minification; 5 - sharing constants; 6 - non-deterministic resolution; 7 - isolation
3
Q
How can themes be broadcasted to components?
A
Via contexts. e.g: const ThemeContext = React.CreateContext({ theme: {} })
4
Q
What are the “magic bits” of webpack? how many of them are necessary?
A
the loaders. each file type is likely to have one or more loaders.
5
Q
What happens when a specific file type needs more than one loader?what is the precedence?
A
loaders from right to left will be used.
6
Q
What are the alternatives for webpack?
A
Rollup and Parcel
7
Q
When Parcel is recommended? Why?
A
For very simple projects. Because it allows quick setups.