react.js Flashcards

1
Q

how many outer elements should a jsx expression have?

A

only one , to make sure that theres only one ,wrap it all inside a div tag or an empty tag

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

what about self closing tags is important in jsx

A

always include a slash in the end to not get errors ex : <img></img>

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

how do i add regular js inside jsx

A

use curly braces ex:

<h1>{myVariable}</h1>

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

what is the && operator in react

A

the expression to the right of the && operator only activates if the statement to the left is true else its ignored ex:
{ rich && buyBuggati}

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