pancake-toolkit
pancake-toolkit copied to clipboard
feat: Allow props to be given to dynamic modals via onPresentCallback
Your context-based dynamic modal provider is very nice. There are certain cases however, where it might be nice to call the onPresentCallback with additional props for the modal (only known at runtime).
For example....
const { onPresent, onDismiss, isOpen } = useUpgradeModal(handleUpgrade, handleWait)
...
onPresent({ currentVersion: CURRENT_VERSION, newVersion: DEPLOYED_VERSION})
The included PR allows props to be passed to the onPresent handler, and then onward to ModalContext
Hope this helps. ;-)