Skip to content

[Suggestion]: Add missing onChange handlers to input elements in server-functions.md documentation examples #7921

@rowleks

Description

@rowleks

Summary

Add missing onChange handlers to input elements in the documentation examples for Server Functions, especially in server-functions.md. This will make the examples more accurate and prevent confusion for users learning about controlled inputs and. also make the code example valid

Page

https://react.dev/reference/rsc/server-functions or directly in src/content/reference/rsc/server-functions.md

Details

Some input elements in the Server Functions documentation (notably in the UpdateName component) currently lack onChange handlers. This makes the examples misleading, as users cannot update the value of these controlled inputs. Adding the appropriate onChange handlers will clarify correct usage and improve the learning experience.

Example code improvement:

Expected:

<input type="text" name="name" value={name} onChange={e => setName(e.target.value)} />

Actual:

<input type="text" name="name" />

Updating these examples will help reinforce best practices for controlled inputs in React.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions