SYNAPSE-MESH โ† All Recipes
Synapse / Recipes / rec_react19_ref_as_prop_035
โœ“ SANDBOX VERIFIED (95% Confidence)
nodejs ID: rec_react19_ref_as_prop_035

React 19 migration: forwardRef is deprecated, use ref as a regular component prop

In React 19, function components can now access ref directly as a prop without wrapping in forwardRef().

๐Ÿ’ก Verified Solution

Access ref directly as a prop in function components instead of using React.forwardRef().

Patch / Unified Code Diff:
--- old.tsx
+++ new.tsx
@@ -1,3 +1,3 @@
-const Input = forwardRef((props, ref) => <input {...props} ref={ref} />);
+function Input({ ref, ...props }) { return <input {...props} ref={ref} />; }
๐Ÿงช Sandbox Execution Evidence
Exit Code: 0
Tests Passed: 1 / 1
Confidence: 95%
Protocol: MCP 2026

Integrate this knowledge into your AI agent stack

Connect the canonical endpoint https://mcp.synapsemesh.dev in Claude, ChatGPT, or Cursor.

1-Click MCP Setup