next.js
323a9c9f - patch react via recast instead of string replacements (#78916)

Commit
360 days ago
patch react via recast instead of string replacements (#78916) In #78838, we've seen that patching react via string replacements is problematic, because we accidentally replaced a `setTimeout` in a string literal (emitted into HTML by Fizz). This PR converts most of our react patching to use `recast` instead. This also lets us be smarter about how we convert `setTimeout` to `setTimeoutOrImmediate` -- i'm removing the duration arg, and potentially preserving `setTimeout(fn, 0, ...ARGS_FOR_CALLBACK)`
Author
Parents
Loading