{"record":{"id":"ae4ff54d7e6b9fe9","repo":"facebook/react","slug":"375","errorCode":"375","errorMessage":"Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.%s","messagePattern":"Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\"\\. Or maybe you meant to call this function rather than return it\\.(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFlightServer.js","lineNumber":4289,"sourceCode":"      );\n    } else if (\n      __DEV__ &&\n      (jsxChildrenParents.has(parent) ||\n        (jsxPropsParents.has(parent) && parentPropertyName === 'children'))\n    ) {\n      const componentName = value.displayName || value.name || 'Component';\n      throw new Error(\n        'Functions are not valid as a child of Client Components. This may happen if ' +\n          'you return ' +\n          componentName +\n          ' instead of <' +\n          componentName +\n          ' /> from render. ' +\n          'Or maybe you meant to call this function rather than return it.' +\n          describeObjectForErrorMessage(parent, parentPropertyName),\n      );\n    } else {\n      throw new Error(\n        'Functions cannot be passed directly to Client Components ' +\n          'unless you explicitly expose it by marking it with \"use server\". ' +\n          'Or maybe you meant to call this function rather than return it.' +\n          describeObjectForErrorMessage(parent, parentPropertyName),\n      );\n    }\n  }\n\n  if (typeof value === 'symbol') {\n    const writtenSymbols = request.writtenSymbols;\n    const existingId = writtenSymbols.get(value);\n    if (existingId !== undefined) {\n      return serializeByValueID(existingId);\n    }\n    // $FlowFixMe[incompatible-type] `description` might be undefined\n    const name: string = value.description;\n\n    if (Symbol.for(name) !== value) {","sourceCodeStart":4271,"sourceCodeEnd":4307,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFlightServer.js#L4271-L4307","documentation":"The general function case: a plain function value (not an event handler, not a child) is being passed as a prop from a Server Component to a Client Component. The Flight wire format only carries functions that are explicitly exposed Server References, so any other function hits this error. The message offers both outs: mark it 'use server' if you intended a callable action, or stop passing it if you meant to call it.","triggerScenarios":"<ClientList sort={(a, b) => a.id - b.id}/>; <ClientChart formatter={v => v + 'px'}/>; passing any comparator, predicate, or utility callback from a server file into a client component's props.","commonSituations":"Passing formatters, sorters, predicates, or class-static helpers as props; sharing utility modules between server and client trees; migrating callback-style APIs into RSC pages.","solutions":["If the function should run on the client, move it (or the component using it) into a 'use client' module.","If it should run on the server, add 'use server' to expose it as a Server Action and pass the reference.","Replace the function with serializable configuration (a preset name or options object) that the client maps back to behavior."],"exampleFix":"// before\n<ClientTable sort={(a, b) => a.id - b.id} rows={rows} />\n\n// after — behavior selected by data\n<ClientTable sort=\"byId\" rows={rows} />\n// ClientTable.tsx ('use client') maps 'byId' to a local comparator","handlingStrategy":"type-guard","validationCode":"export function scanPropsForFunctions(props: Record<string, unknown>, path = ''): string[] {\n  const out: string[] = [];\n  for (const [k, v] of Object.entries(props)) {\n    if (typeof v === 'function') out.push(path + k);\n    else if (v && typeof v === 'object' && !(v instanceof Date)) out.push(...scanPropsForFunctions(v as any, path + k + '.'));\n  }\n  return out;\n}","typeGuard":"export function isServerAction(v: unknown): boolean {\n  return typeof v === 'function' && String((v as any).$$typeof ?? '').includes('react.server.reference');\n}","tryCatchPattern":null,"preventionTips":["Treat props crossing the RSC boundary as data: strings, numbers, plain objects, arrays.","Centralize behavior presets on the client and pass keys.","Keep server-callable behavior in 'use server' files."],"tags":["functions","props","server-actions","server-components"],"backgroundTag":"server-component-props","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}