[replaceWithToast] is required
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start by locating the redirectWithToast utility and compare its behavior with the Remix replace utility referenced in the issue. Verify the new replaceWithToast behavior for both the current Remix users and the newer React Router version, including toast delivery without duplication; the payload does not name specific files or tests.
Written by the indexing model from the issue text.
Description
redirectWithToast uses history.pushState, which causes the redirected URL to be added to the browser history. However, in some cases, we need to use history.replaceState instead while redirecting.
Example use case:
Let's say we have a products page at /products. We open the /products/new URL to add a new product. When the product is successfully created, we redirect to /products/{product_id}. However, in this case, pressing the back button on the product page brings the user back to /products/new, which is not desirable. Or think of I deleted /products/{product_id} and redirected to /products, now back navigation will bring me to a non-existing product.
If we try to solve this by returning jsonWithToast and then navigating manually using navigate('...', { replace: true }), we encounter duplicated toasts because the page navigates to the new URL very shortly after the toast cookie is flashed.
Proposal:
I would like to propose creating a replaceWithToast utility, which works exactly the same as redirectWithToast, but uses replace instead of redirect.
Note: I still use [email protected] because some of our dependencies doesn't allow my switch to react-router@7. So I would be appreciated if you could also implement this feature for [email protected] which is still the latest stable version for "remix" users.
- Dominant language
- TypeScript
- Stars
- 260
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-forge-io/remix-toast
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
code-forge-io/remix-toast#52 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
code-forge-io/remix-toast#50 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
code-forge-io/remix-toast#42 · 4 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
code-forge-io/remix-toast#37 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
code-forge-io/remix-toast#26 · 10 comments ·
All issues in code-forge-io/remix-toast
Similar issues
-
bug(core): JsonOutputKeyToolsParser ignores returnId: truePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/langchainjs#12239 ·
Maintainers usually reply within 1 day
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
paperclipai/paperclip#21837 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
code-yeongyu/senpi#6813 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 93/100
lingdojo/kana-dojo#34169 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100