Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Pages: actions commit the `?actionName` URL to history

Open
#527 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript, vite
Domain
frontend

Research direction

Start by tracing makeCommit() and how visits set preserveState and commitTarget.fetchUrl; the issue identifies this history-writing logic as the cause. Compare the behavior with #506 and reproduce using useForm('/db?create', …) or action('/db?create', { data }) on /db. Done means a non-redirecting action keeps /db in the address bar and does not add a history entry for each submission.

Written by the indexing model from the issue text.

Description

Description

When a named action finishes without redirecting, the router writes the action URL into the address bar with pushState. For example, submitting useForm('/db?create', …) on /db leaves the browser at /db?create. Each later submit adds another history entry.

Steps to reproduce

  1. Define named actions on a page:
    // pages/db.server.ts
    export const actions = {
      create: defineHandler.withValidator({ body: schema })(async (_c, { body }) => {
        await createNote(body);
      }),
    };
    
  2. On /db, submit useForm('/db?create', …), or call action('/db?create', { data }).
  3. Check location.href and history.length.

Actual behavior

  • The address bar shows /db?create, or /db?delete after another action.
  • history.length goes up by one on every submit, so Back steps through each submission before leaving the page.

Expected behavior

An action that re-renders the current page should keep the page's URL (/db). It should either leave the history alone or replace the current entry. The docs describe a void return as "re-runs the loader, page re-renders with fresh props", which suggests staying on the page.

Cause

makeCommit() writes commitTarget.fetchUrl to history for every visit that doesn't set preserveState, including non-GET visits. useForm and action() don't expose preserveState or replace, so callers can't opt out. Returning c.redirect('/db') avoids the wrong URL, but it adds a round trip and still pushes an entry.

Related

#506 changes the same history-writing logic in makeCommit().

Environment

  • void 1.1.12
  • @void/react 1.1.12
Dominant language
TypeScript
Stars
402
Forks
32
Avg merge
10h 51m
Merged PRs (30d)
100

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from voidzero-dev/void

All issues in voidzero-dev/void

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.