FrontendDeveloper.in

React Track Detail

How do you access props in attribute quotes?

React (or JSX) doesn't support variable interpolation inside an attribute value. The below representation won't work:

But you can put any JS expression inside curly braces as the entire attribute value. So the below expression works:

Using template strings will also work: