Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 95c9554bc72813b0ee2b028774bb7cf0482887ba
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a3e39cebb8fac2602ddc0d75ab7eea48a3254500
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 14, 2023

  1. useFormState: MPA submissions to a different page

    The permalink option of useFormState controls which page the form is
    submitted to during an MPA form submission (i.e. a submission that
    happens before hydration, or when JS is disabled). If the same
    useFormState appears on the resulting page, and the permalink option
    matches, it should receive the form state from the submission despite
    the fact that the keypaths do not match.
    
    So the logic for whether a form state instance is considered a match is:
    - Both instances must be passed the same action signature
    - If a permalink is provided, the permalinks must match.
    - If a permalink is not provided, the keypaths must match.
    
    Currently, if there are multiple matching useFormStates, they will all
    match and receive the form state. We should probably only match the
    first one, and/or warn when this happens. I've left this as a TODO for
    now, pending further discussion.
    acdlite committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    a3e39ce View commit details
    Browse the repository at this point in the history
Loading