Answer the question
In order to leave comments, you need to log in
How to make a tooltip in React?
Let's say we have this code:
var someVariable = React.createClass({
render: function() {
return React.createElement('div', {className: 'drivers-shifts'},[
React.createElement(Hsvg, {href: 'car', cssClass: "car-md car-icon"}),
React.createElement('h2', {className:'margin'}, this.state.values.free),
React.createElement(Hsvg, {href: 'driver', cssClass: "driver-md driver-icon"}),
React.createElement('h2', {className:'margin'}, this.state.values.onShift)]
)
}
});
Answer the question
In order to leave comments, you need to log in
The solution turned out to be in additional nesting:
React.createElement('div', {className: 'car-icon_wrap tooltips', 'data-tooltip': 'Свободные водители'},
React.createElement(Hsvg, {href: 'car-icon', cssClass: "car-md car-icon -online "})
),
React.createElement('h2', {className:'margin'}, this.state.values.free),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question