MCPcopy Create free account
hub / github.com/react/react / greet

Function greet

fixtures/flight/src/actions.js:16–26  ·  view source on GitHub ↗
(formData)

Source from the content-addressed store, hash-verified

14}
15
16export async function greet(formData) {
17 const name = formData.get('name') || 'you';
18 setServerState('Hi ' + name);
19 const file = formData.get('file');
20 if (file) {
21 return `Ok, ${name}, here is ${file.name}:
22 ${(await file.text()).toUpperCase()}
23 `;
24 }
25 return 'Hi ' + name + '!';
26}
27
28export async function increment(n) {
29 // Test loading state

Callers

nothing calls this directly

Calls 2

setServerStateFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected