Skip to content

Commit ccf2542

Browse files
committed
Update version 0.2.0 and new api documentations
1 parent 76321f0 commit ccf2542

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,21 @@ ReactDom.render(
131131
132132
`GoodBye` is the consumer component of the GoodBye context. This component must be in the subtree of `Provider` or decorated router provider.
133133
134-
| props | type | default | description |
135-
|-------|---------|---------|----------------------------------------------------------------------|
136-
| when | Boolean | false | make render props `isShow` to be true when routing transition occurs |
134+
| props | type | default | description |
135+
|-------------------|---------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
136+
| when | Boolean | false | Make render props `isShow` to be true or false when routing transition occurs. |
137+
| alertBeforeUnload | Boolean | false | Turn on the browser alert. Technically, when you **refresh** or **close** browser window, only browser itself can detect and popup alert for you. If you want to remind the user when doing actions above, turn on this option. |
138+
| alertMessage | String | '' | Custom browser alert messages. Note that this option only works for **IE**. |
137139
138140
**react-goodbye** will handle all of the code logic for you. Use provided `render props` to show whatever you want (modal, lightbox, dialog, popup, etc)
139141
140-
| render props | type | default | description |
141-
|--------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------|
142-
| isShow | Boolean | false | while `when` prop is true, `isShow` will be true when routing transition occurs. |
143-
| handleOk | function | | allow routing transition and make `isShow` to be **false** again |
144-
| handleCancel | function | | block routing transition and make `isShow` to be **false** again |
145-
| pass | function | | low-level api under `handleOk` and `handleCancel`; pass **true** will allow routing transitions, while pass **false** will not. |
142+
| render props | type | default | description |
143+
|--------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------|
144+
| isShow | Boolean | false | While `when` prop is true, `isShow` will be true when routing transition occurs. You can put your dialog component here. |
145+
| handleOk | function | | Allow routing transition and make `isShow` to be **false** again. |
146+
| handleCancel | function | | Block routing transition and make `isShow` to be **false** again. |
147+
| pass | function | | Low-level api under `handleOk` and `handleCancel`; pass **true** will allow routing transitions, while pass **false** will not. |
148+
146149
## License
147150
148151
MIT © [xJkit](https://github.com/xJkit)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-goodbye",
3-
"version": "0.1.9",
3+
"version": "0.2.0",
44
"keywords": [
55
"react",
66
"react-router",

0 commit comments

Comments
 (0)