callstack / callstack/react-native-paper
Add keepMounted flag to Modal/Dialog
- 主要言語
- TypeScript
- スター
- 14.5k
- フォーク
- 2.2k
- 平均マージ
- 5日 23時間
- マージ済み PR(30日)
- 12
説明
**Is your feature request related to a problem? Please describe.**
Yes. It would be nice to persist the content sent to a modal/dialog even after it is closed to improve rendering performance.
**Describe the solution you'd like**
The default behavior of mounting the content when the modal/dialog is visible and unmounting it on close animation is great. However, I would like a way to keep the content mounted regardless if it is open. Two options could exist:
1. `after-first` - After opening for the first time, mount the content and keep keep it mounted for subsequent opens
2. `always` - Eagerly mount the content right away and again keep it mounted
Proposing new flag `mountingBehavior` on modal/dialog of type: `'open-only' | 'after-first' | 'always'` defaulted to `'open-only'`
**Describe alternatives you've considered**
I'm in the process of creating a custom dialog to accomplish this.
**Additional context**
[MUI](https://mui.com/material-ui/api/modal/#modal-prop-keepMounted) has a `keepMounted` flag for this.
コントリビューションガイド
調査の方向性
Start by locating the Modal and Dialog entry points and their current open-only mounting behavior. Review how the proposed mountingBehavior values—open-only, after-first, and always—should apply to both components. Done means the new default preserves existing behavior and each requested option keeps content mounted as specified.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react-native, typescript
- 領域
- mobile
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100