Reputation: 1242
Just starting out in react and I've got a tooltip as part of a cart that I need to set the text for.
<a href="#" class="psh-Delivery_Link tip-Tooltip" data-tooltip={{ window.theme.strings.pushCart.deliveryToolTipText }}>test</a>
so I went to set the data-tooltip
attribute, but this is giving me an error. Also tried data-tooltip="' + window.theme.strings.pushCart.deliveryToolTipText + '
Upvotes: 0
Views: 442
Reputation: 435
Take a look at the React tutorial on props. In summary, if you want to send a prop that is a string you can simple enclose it in quotes.
<a prop="value">
Otherwise use single curly braces (in which you can write any JavaScript statement)
<a prop={value.foo}>
Upvotes: 0
Reputation: 432
Try to change
data-tooltip={{ window.theme.strings.pushCart.deliveryToolTipText }}
To
data-tooltip={window.theme.strings.pushCart.deliveryToolTipText }
Upvotes: 2