Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-dismissible
Advanced tools
Readme
Make your components dismissible!
useDismissible
hookimport { useDismissible } from 'react-dismissible'
import { SomeModal } from './some-modal' // not real
function ComfirmButton(props) {
let [isVisible, setModalVisibiility] = React.useState(false)
const dismissible = useDismissible({
onDismiss: () => setModalVisibility(false)
click: true, // call onDismiss if clicking outside of this modal
escape: true, // call onDismiss if the user presses escape
})
return (
<>
<button {...props} onClick={() => setModalVisiblity(true)} />
{isVisible && (
<SomeModal ref={dismissible}>
<button onClick={() => setModalVisiblity(false)}>Cancel</button>
<button onClick={props.onClick}>Do it!</button>
</SomeModal>
)}
</>
)
}
Dismissible
componentimport { Dismissible } from 'react-dismissible'
import { SomeModal } from './some-modal' // not real
function ComfirmButton(props) {
let [isVisible, setModalVisibiility] = React.useState(false)
return (
<>
<button {...props} onClick={() => setModalVisiblity(true)} />
{isVisible && (
<SomeModal>
<Dismissible
click // call onDismiss if clicking outside of this modal
escape // call onDismiss if the user presses escape
onDismiss={() => {
setModalVisibility(false)
}}
>
<button onClick={() => setModalVisiblity(false)}>Cancel</button>
<button onClick={props.onClick}>Do it!</button>
</Dismissible>
</SomeModal>
)}
</>
)
}
interface DismissibleProps {
onDismiss: Function
click?: boolean
escape?: boolean
disabled?: boolean
document?: Document
allowClickPropagation?: boolean
}
FAQs
Make your components dismissible!
The npm package react-dismissible receives a total of 769 weekly downloads. As such, react-dismissible popularity was classified as not popular.
We found that react-dismissible demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.