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;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can themes be broadcasted to components?

A
Via contexts. e.g:
const ThemeContext = React.CreateContext({ theme: {} })
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the alternatives for webpack?

A

Rollup and Parcel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When Parcel is recommended? Why?

A

For very simple projects. Because it allows quick setups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly