4. Styling In React And Rendring Arrays JS Flashcards

1
Q

How do you link a CSS file to a component file?

A

import ‘relative file path of the CSS file’

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

In which file would you import the general.css file?

A

index.js file (entry point of the application)

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

How is an array rendered within JSX?

A

function parentComponent() { return (<div>{array.map((el) => { return ; })}</div>); }

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

How is inline styling done with JSX elements?

A
<element style={{cssproperty: val, cssproperty: val}}></element>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is an array rendered within JSX?

A
function parentComponent() { return (<div>{array.map((el) => { return <componentName element={el} key={el.id} />; })}</div>); }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly