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
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>
3
Q
how do i add regular js inside jsx
A
use curly braces ex:
<h1>{myVariable}</h1>
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}