Skip to content

Instantly share code, notes, and snippets.

@timc1
Last active March 23, 2019 20:51
Show Gist options
  • Save timc1/1ba551ba69ce605548e1f9e601f18cb3 to your computer and use it in GitHub Desktop.
Save timc1/1ba551ba69ce605548e1f9e601f18cb3 to your computer and use it in GitHub Desktop.
Wrap a button/link component with multi confirmation
import React from 'react'
export function WithConfirmation({ children }) {
const [hasConfirmed, setConfirm] = React.useState(false)
return children({
hasConfirmed,
setConfirm,
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment