Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-hint
Advanced tools
react-hint is a small tooltip component for React which is developed with simplicity and performance in mind. It doesn't include any fancy stuff, but it gets the job done. It also plays nicely with Preact and Inferno (1.0.0-beta3). Demo page.
npm i -S react-hint
<ReactHint />
is a singleton component. To show a tooltip on any DOM element and its children add data-rh
attribute to the element. The default placement of a tooltip is at the top, but you can add data-rh-at
attribute to change the placement. Supported values are: top
, left
, right
, bottom
. You can completely override tooltip style by passing className
property to <ReactHint />
.
import React from 'react'
import {render} from 'react-dom'
import ReactHint from 'react-hint'
import 'react-hint/css/index.css'
class Demo extends React.Component {
state = {count: 0}
componentDidMount() {
setInterval(() => {
this.setState({count: this.state.count + 1})
ReactHint.instance.forceUpdate()
}, 1000)
}
render() {
const {count} = this.state
return (
<div>
<button data-rh="Default">Default</button>
<button data-rh="Top" data-rh-at="top">Top</button>
<button data-rh="Left" data-rh-at="left">Left</button>
<button data-rh="Right" data-rh-at="right">Right</button>
<button data-rh="Bottom" data-rh-at="bottom">Bottom</button>
<button data-rh={`Count: ${count}`}>Count: {count}</button>
<ReactHint />
</div>
)
}
}
render(<Demo />, document.getElementById('demo'))
react-hint uses shouldComponentUpdate under the hood to decide if it needs to be updated. You can use ReactHint.instance.forceUpdate()
in case you want to force an update.
MIT
FAQs
Tooltip component for React, Preact, Inferno
The npm package react-hint receives a total of 3,756 weekly downloads. As such, react-hint popularity was classified as popular.
We found that react-hint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.