You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to apply styles to react-portal-tooltip with a styled-components,
but i can't.
The solution may be using inline styles in different syntax, which makes DX worse
Example with styled-components:
import React from 'react'
import ToolTip from 'react-portal-tooltip'
import styled from 'styled-components'
const ToolTipStyled = styled(ToolTip)`
color: #fff;
background-color: #000;
z-index: 99999
`
class MyComponent extends React.Component {
state = {
isTooltipActive: false
}
showTooltip() {
this.setState({isTooltipActive: true})
}
hideTooltip() {
this.setState({isTooltipActive: false})
}
render() {
return (
<div>
<p id="text" onMouseEnter={this.showTooltip.bind(this)} onMouseLeave={this.hideTooltip.bind(this)}>This is a cool component</p>
<ToolTipStyled active={this.state.isTooltipActive} position="top" arrow="center" parent="#text">
<div>
<p>This is the content of the tooltip</p>
<img src="image.png"/>
</div>
</ToolTip>
</div>
)
}
}
The text was updated successfully, but these errors were encountered:
I want to apply styles to react-portal-tooltip with a styled-components,
but i can't.
The solution may be using inline styles in different syntax, which makes DX worse
Example with styled-components:
The text was updated successfully, but these errors were encountered: