Fix react/no-danger eslint problem
[MAILPOET-976]
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
Reference in New Issue
Block a user