Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#527 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@0froq がすでに取り組んでいます。

2026年10月23日 から。

  • #566 @0froq による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript, vite
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
402
フォーク
32
平均マージ
8時間 32分
マージ済み PR(30日)
111

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/void のほかの issue

voidzero-dev/void の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。