Component `Modal ` provider a API `Model.open` to create and open a new instance of `Modal `
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
i have a list or table. every list item (row) have a action list. there are some feature in action list:
- open a modal to edit this row
- open a modal to show details of this row
- do some thing need to input password or key word to confirm …
if there are too many action need to open a Modal
, i need to maintain stateA, stateB, stateC…
And some time i need to clear this state after close Modal
instance.
it is too heavy…
This API is not recommended, but it is still necessary for implementation.
What does the proposed API look like?
Modal.open(props)
. like Modal.warn
Model.open({
title: 'title',
onConfirm: () => {},
onCancel: () => {},
children: () => <div></div>
......
})
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Implement a Modal Component in React - DigitalOcean
Build a modal component in your React project using props and state to control displaying and closing.
Read more >Your next React Modal with your own "useModal" Hook ...
Hi there everyone, this is a quick review about how to use Modals Components in your React project combining Hooks, Context, and Portals....
Read more >Build a simple Modal Component with React - Bits and Pieces
These are the steps for this tutorial: What we'll learn. Create a simple file structure; Use react toggle state to build a simple...
Read more >4 steps to set up global modals in React - Opensource.com
1. Create a global modal component · 2. Create modal dialog components · 3. Integrate GlobalModal into the top-level component in your application....
Read more >ion-modal: Ionic Mobile App Custom Modal API Component
ion-modal is a dialog that appears on top of mobile app content, and must be dismissed before interaction resumes. Learn more about custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
MyModal.js
angular version of antd provides an open method, while the imperative call is not recommended in React, it is not means that React prohibit using it. And also why are you provide Modal.info, Modal.success, Modal.error,Modal.warning and Modal.confirm methods? These methods do not violate the recommendation?