react-confirm 0.3.0-3 → 0.3.0-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,10 @@ react-confirm library offers several benefits:
|
|
|
23
23
|
- The library provides flexibility in designing the dialog. There is no limitation in the type of components you can use, whether it be input forms or multiple buttons. You can even check out the demo site to see examples of how to customize the dialog.
|
|
24
24
|
|
|
25
25
|
## Demo
|
|
26
|
-
https://
|
|
26
|
+
[](https://stackblitz.com/fork/github/haradakunihiko/react-confirm-sample/tree/main/1_typescript)
|
|
27
|
+
|
|
28
|
+
Please note that interactions with the sample dialogs output details to the console. Review the console output while interacting with the dialogs to observe the behavior and outcomes.
|
|
29
|
+
|
|
27
30
|
|
|
28
31
|
## Versions
|
|
29
32
|
|
|
@@ -106,6 +109,8 @@ const handleOnClick2 = async () => {
|
|
|
106
109
|
You can check more complex example in [codesandbox](https://codesandbox.io/s/react-confirm-with-react-bootstrap-kjju1)
|
|
107
110
|
|
|
108
111
|
## Using with Context
|
|
112
|
+
[](https://stackblitz.com/fork/github/haradakunihiko/react-confirm-sample/tree/main/2_typescript_using_context)
|
|
113
|
+
|
|
109
114
|
By default, this library renders the confirmation dialog without appending the component to your app's React component tree. While this can be useful, it may cause issues if you need to consume context in your component. To overcome this problem, you can use the `MountPoint` component to include your confirmation dialog within your app's tree, enabling it to access context and other data from the app.
|
|
110
115
|
|
|
111
116
|
Create your own `createConfirmation` function and `MountPoint` Component using `createConfirmationCreater` and `createReactTreeMounter`.
|
|
@@ -153,4 +158,4 @@ const Confirmation1: React.FC<ConfirmDialogProps<Props, Response>> = (props) =>
|
|
|
153
158
|
const Confirmation2: ConfirmDialog<Props, Response> = (props) => (<Dialog></Dialog>)
|
|
154
159
|
```
|
|
155
160
|
|
|
156
|
-
|
|
161
|
+
When defining your dialog component, set both the `Props` for the dialog and the `Response` value to be passed when the dialog closes. This will be handy when calling the dialog.
|