File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+
3+ /** Use Your Own Custom Save Reminder Component */
24import SaveReminder from '../components/SaveReminder' ;
35
46class Portfolio extends React . Component {
@@ -15,7 +17,11 @@ class Portfolio extends React.Component {
1517 const isValueModified = initialValue !== currentValue ;
1618 return (
1719 < div >
18- < SaveReminder when = { initialValue !== currentValue } />
20+ < SaveReminder
21+ when = { initialValue !== currentValue }
22+ alertBeforeUnload
23+ alertMessage = "No! No! No! Save before leave! Do you want to leave? Q.Q" // only work for IE
24+ />
1925 < h2 > Portfolio Page</ h2 >
2026 < span > Your Name:</ span >
2127 < span >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Settings extends React.Component {
2020 < GoodBye
2121 when = { isModified }
2222 alertBeforeUnload
23- alertMessage = "Save before leave. Do you want to continue? " // only work for IE
23+ alertMessage = "No! No! No! Save before leave! Do you want to leave? Q.Q " // only work for IE
2424 >
2525 { ( { isShow, handleOk, handleCancel } ) =>
2626 isShow && (
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ import '@trendmicro/react-modal/dist/react-modal.css';
99/** */
1010
1111/** Custom Common Save Reminder Modal */
12- export default ( { when } ) => (
13- < GoodBye when = { when } >
12+ export default ( props ) => (
13+ < GoodBye { ... props } >
1414 { ( { isShow, handleCancel, handleOk } ) => isShow && (
1515 < Modal
1616 show
You can’t perform that action at this time.
0 commit comments