Releases: xJkit/react-goodbye
Releases · xJkit/react-goodbye
Add Conditional Prompt
Avoid having isShow as true after handleCancel action
Thanks to #11 for this minor fix.
Fix unintentional re-renders
Thanks for the discussion from #8, I made a improvement by #9
- Refactor GoodBye Provider with bound object literal that avoids the new React 16.3 context caveats which may leads to unintentional re-render
- Rename
pass
function tohandlePass
. It allows you to do additional actions (of course, you can wrap thehandleOk
orhandleCancel
with your own higher-order function!).
Add window alert support
-
alertBeforeUnload
- When this props is true, the component will also add
onbeforeunload
event to the window object that detects the page to popup an alert before you leave without saving data changes. - This event fires when user close or reload the current page. The reason is that there is no way to detect close/reload actions except this event.
- When this props is true, the component will also add
-
alertMessage
- Custom browser popup message.
- Note that the text message is only for IE users due to browser limitation.
enhance test coverage
- Add test cases for withGoodBye and Provider
- Do not log error message in production when error occurs