Skip to content

Commit

Permalink
Merge pull request #77 from haradakunihiko/feature/add-stackblitz
Browse files Browse the repository at this point in the history
add stackblitz link
  • Loading branch information
haradakunihiko committed Sep 8, 2023
2 parents dd1bb8d + 25484f5 commit 31c11f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ react-confirm library offers several benefits:
- 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.

## Demo
https://codesandbox.io/s/react-confirm-with-react-bootstrap-kjju1
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/haradakunihiko/react-confirm-sample/tree/main/1_typescript)

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.


## Versions

Expand Down Expand Up @@ -106,6 +109,8 @@ const handleOnClick2 = async () => {
You can check more complex example in [codesandbox](https://codesandbox.io/s/react-confirm-with-react-bootstrap-kjju1)

## Using with Context
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/haradakunihiko/react-confirm-sample/tree/main/2_typescript_using_context)

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.

Create your own `createConfirmation` function and `MountPoint` Component using `createConfirmationCreater` and `createReactTreeMounter`.
Expand Down

0 comments on commit 31c11f1

Please sign in to comment.