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’
2
Q
In which file would you import the general.css file?
A
index.js file (entry point of the application)
3
Q
How is an array rendered within JSX?
A
function parentComponent() { return (<div>{array.map((el) => { return ; })}</div>); }
4
Q
How is inline styling done with JSX elements?
A
<element style={{cssproperty: val, cssproperty: val}}></element>
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>); }