Skip to content

Commit b508af7

Browse files
chore(readme): added full screen dialog doc to readme
1 parent 49ed8d3 commit b508af7

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,53 @@ export const YourComponent = () => {
391391
| prepend | - | ReactNde | - |
392392
| append | - | ReactNde | - |
393393

394-
![circular activity indicator gif](https://ik.imagekit.io/Computools/rn-material-components/circular-indicator-gif.gif?updatedAt=1705066319093)
395-
</details></details>
394+
![basic dialog gif](https://ik.imagekit.io/Computools/rn-material-components/basic-dialog.gif?updatedAt=1729261989459)
395+
</details>
396+
<details><summary>Full screen Dialog</summary>
397+
<br />
398+
399+
**Properties**
400+
animationDuration?: number;
401+
animationType?: AnimationType;
402+
403+
| name | description | type | default |
404+
| ------ | ------ | ------ | ----|
405+
| animationType | - | 'slide', 'fade', 'zoom' | 'slide' |
406+
| animationDuration | - | number | 330 |
407+
408+
![full screen dialog gif](https://ik.imagekit.io/Computools/rn-material-components/full-screen-dialog.gif?updatedAt=1729261989519)
409+
</details>
410+
</details>
411+
<details><summary>Troubleshooting</summary>
412+
<br />
413+
414+
**Modal unexpectedly reappear**
415+
416+
In some cases, a modal may unexpectedly reappear after being closed, especially when certain actions like navigation functions are triggered during or immediately after the modal's closure. This happens because the UI thread can be busy handling other interactions (e.g., button presses, transitions), leading to a race condition where the modal is shown again.
417+
418+
To prevent this, you can use ```InteractionManager.runAfterInteractions```. This ensures that your actions (like navigation) are executed only after all ongoing interactions are finished, providing a smoother and more predictable user experience.
419+
420+
421+
_See the example how to use:_
422+
```
423+
const onSubmitPress = async () => {
424+
const isSuccessfullySignedOut = await signOut();
425+
426+
if (isSuccessfullySignedOut) {
427+
InteractionManager.runAfterInteractions(() => {
428+
navigation.dispatch(
429+
CommonActions.reset({
430+
index: 0,
431+
routes: [{name: MainStackRoutes.Welcome}],
432+
}),
433+
);
434+
});
435+
}
436+
437+
}
438+
```
439+
</details>
440+
</details>
396441
<details><summary>Divider</summary>
397442
<br />
398443

0 commit comments

Comments
 (0)