Skip to content

Commit 8fdec10

Browse files
sebmarkbagefacebook-github-bot
authored andcommitted
Progressively Enhanced Server Actions (#26774)
Summary: This automatically exposes `$$FORM_ACTIONS` on Server References coming from Flight. So that when they're used in a form action, we can encode the ID for the server reference as a hidden field or as part of the name of a button. If the Server Action is a bound function it can have complex data associated with it. In this case this additional data is encoded as additional form fields. To process a POST on the server there's now a `decodeAction` helper that can take one of these progressive posts from FormData and give you a function that is prebound with the correct closure and FormData so that you can just invoke it. I updated the fixture which now has a "Server State" that gets automatically refreshed. This also lets us visualize form fields. There's no "Action State" here for showing error messages that are not thrown, that's still up to user space. DiffTrain build for commit facebook/react@aef7ce5. Changelog: [Internal] << DO NOT EDIT BELOW THIS LINE >> Reviewed By: christophpurrer Differential Revision: D45548613 Pulled By: tyao1 fbshipit-source-id: 0d4206c18c4818fa410e8b18f3a0f0942237c91b
1 parent 896f3c0 commit 8fdec10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/react-native/Libraries/Renderer
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c10010a6a00911fe99452bc561dd47c3e15f4eb8
1+
aef7ce5547c9489dc48e31f69b002cd17206e0cb

0 commit comments

Comments
 (0)