React-Native-Paystack-WebView
React-Native-Paystack-WebView copied to clipboard
feat(RNPSW): expose the root modal's props for customization
This PR allows the consumer to customize the root modal's props. One specific and important use case is to be able to dismiss the modal on back button press like so;
modalProps={{ onRequestClose: () => paystackWebViewRef.current?.endTransaction() }}
I wanted to document the usage in the Readme but the contribution guide says "All modifications should be made exclusively in the /development directory". Hoping to hear from the maintainer.
@El-Nazy, I see your point, i have updated docs #175, so feel free to update docs accordingly. You can update both the docs and code changes in this one PR.
Also, take time to update your PR to match the requirements for PRs in the contribution docs.
@El-Nazy, I see your point, i have updated docs #175, so feel free to update docs accordingly.
Thank you @just1and0 I'll proceed to make the commit with a docs commit.
Also @El-Nazy we already have a way of closing the modal using ref.
Does this not work for you?
paystackWebViewRef.current.endTransaction()
Also @El-Nazy we already have a way of closing the modal using ref.
Does this not work for you?
paystackWebViewRef.current.endTransaction()
It does work but not on back button press. The react native modal completely absorbs the back button press and can only be handled/accessed through the onRequestClose() callback prop
Also @El-Nazy we already have a way of closing the modal using ref. Does this not work for you?
paystackWebViewRef.current.endTransaction()It does work but not on back button press. The react native modal completely absorbs the back button press and can only be handled/accessed through the
onRequestClose()callback prop
I mean that the root modal does not dismiss on back-button press as tested on android so exposing the modal props helps with that as illustrated in the example earlier
modalProps={{ onRequestClose: () => paystackWebViewRef.current.endTransaction() }}
@just1and0 Sir, please let me know if there are any requirements for the PR that still need to be met.
LGTM
@all-contributors add @El-Nazy for code
:tada: This PR is included in version 4.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: