Skip to content

Instantly share code, notes, and snippets.

@romainberger
Created March 3, 2016 10:27
Show Gist options
  • Save romainberger/90974a9d3228fb15d38b to your computer and use it in GitHub Desktop.
Save romainberger/90974a9d3228fb15d38b to your computer and use it in GitHub Desktop.
React-portal-tooltip with Redux
import React from 'react'
import Tooltip from 'react-portal-tooltip'
import {connect} from 'react-redux'
@connect(state => {
return {
hasError: state.get('error'),
}
})
export default class Test extends React.Component {
render() {
return (
<div>
<input type="text" id="text-input"/>
<ToolTip active={this.props.hasError} position="bottom" arrow="center" parent="#text-input">
<p>Your error message</p>
</ToolTip>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment