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

Add file serialization support to the `form` component / `use_form_data` hook

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
python
Domain
frontend

Research direction

Start with the form component and use_form_data hook, using PR #58 and the original feature in #7 for context. Resolve whether file fields use metadata, multipart upload, or both before implementing. Done means mixed file and regular fields serialize without a reload, the behavior is tested, and documentation is updated.

Written by the indexing model from the issue text.

Description

Description

Follow-up to #58 (the form component and use_form_data hook, which closed #7).

The form component's client-side interception currently serializes non-file fields only. File inputs (<input type="file">) are silently excluded because the submission handler iterates FormData entries and calls .toString() on each value, which for File objects yields [object File] and loses the file content.

The PR description for #58 explicitly deferred this:

Non-file fields only; file serialization is deferred.

Proposed scope

Support forms that contain file inputs, matching how the current behavior treats other input types. Possible options to evaluate:

  • Include file metadata (name, size, type, lastModified) in the serialized form data, without uploading file content — useful for validation/UI feedback on the server.
  • Defer file content upload to a separate multipart POST when the form is submitted, integrating with the router's navigation model.
  • Combination: send metadata for a GET-style/pushState navigation while supporting an optional file payload.

Acceptance criteria

  • Defining a form with one or more <input type="file"> fields does not break serialization of the other fields.
  • File fields are represented in the use_form_data() output in a well-defined way (currently undocumented behavior).
  • No full page reload occurs on submit of a form with file inputs (consistent with #58).
  • A test covers a form that mixes file inputs with regular fields.
  • Documentation updated for file-field behaviour.

Related

  • PR: #58
  • Original feature: #7
Dominant language
Python
Stars
15
Forks
9
Avg merge
9h 57m
Merged PRs (30d)
2

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.

More from reactive-python/reactpy-router

All issues in reactive-python/reactpy-router

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.