Last active
March 23, 2019 20:51
-
-
Save timc1/1ba551ba69ce605548e1f9e601f18cb3 to your computer and use it in GitHub Desktop.
Wrap a button/link component with multi confirmation
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' | |
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