mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
fcfdb89f31d3174ecbbbe09b66b1916f5c7d3f0d
Updates useFormState to allow a sync function to be passed as an action. A form action is almost always async, because it needs to talk to the server. But since we support client-side actions, too, there's no reason we can't allow sync actions, too. I originally chose not to allow them to keep the implementation simpler but it's not really that much more complicated because we already support this for actions passed to startTransition. So now it's consistent: anywhere an action is accepted, a sync client function is a valid input. DiffTrain build for commit https://github.com/facebook/react/commit/77c4ac2ce88736bbdfe0b29008b5df931c2beb1e.
react-fbsource-import
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%