Created
March 3, 2016 10:27
-
-
Save romainberger/90974a9d3228fb15d38b to your computer and use it in GitHub Desktop.
React-portal-tooltip with Redux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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