eBay / eBay/nice-modal-react

[Request] Add a modal.removeResolve(false) helper function

Open
#88 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

In all my modal components, I either return a response, or if the user closes the modal I do something like this:

<Modal
    onClose={() => {
       modal.resolve(false);
       modal.remove();
    }}
>

However, this is not ideal since I'm passing a new onClose function instance on each render. It would be great if there was a utility function on the modal instance that did both of these steps in one. 🙌

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the modal instance methods used by the example, especially resolve and remove, and inspect how modal components expose or invoke them. Add a helper that combines the demonstrated close behavior, then verify that closing a modal resolves false and removes it without requiring a separately created onClose callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.