I am new to react.
I have been experimenting on react and I got stuck on how to pass array using props.
case-1:
var c = [\'program\'];
var Naviga
The curly braces only need to be used within JSX elements. Like this:
In the case above, the {}
is the way of saying: "Evaluate the expression that I passed within and pass it as a prop". Within the {}
you can pass any valid JavaScript object or expression. Note that if you pass a string, and specifically for strings, you don't need the curly braces... like
.
The above code is the equivalent of this:
var myArray = ['something'];