Fix react/no-danger eslint problem

[MAILPOET-976]
This commit is contained in:
Pavel Dohnal
2017-08-03 10:44:10 +02:00
parent c466e53681
commit 3a0669e1a2
5 changed files with 17 additions and 24 deletions

View File

@@ -1,13 +1,19 @@
import React from 'react';
import ReactTooltip from 'react-tooltip';
import ReactHtmlParser from 'react-html-parser';
function Tooltip(props) {
let tooltipId = props.tooltipId;
let tooltip = props.tooltip;
// tooltip ID must be unique, defaults to tooltip text
if(!props.tooltipId && typeof props.tooltip === "string") {
tooltipId = props.tooltip;
}
if(typeof props.tooltip === "string") {
tooltip = ReactHtmlParser(props.tooltip);
}
return (
<span>
<span
@@ -26,7 +32,7 @@ function Tooltip(props) {
id={tooltipId}
efect="solid"
>
{props.tooltip}
{tooltip}
</ReactTooltip>
</span>
);