Unverified Commit f012eab0 authored by Josh Story's avatar Josh Story Committed by GitHub

use a function expression to access arguments binding (#43987)

arrow function was trying to use arguments binding but wanted arguments
of the lambda not the nearest normal function. The narrowest change is
to convert to function expression. We could also use varargs rest syntax
since this runs in runtimes that should all support that I think. I
don't think it really matters though.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
parent 8e043983
...@@ -52,7 +52,7 @@ const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge' ...@@ -52,7 +52,7 @@ const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'
function preloadComponent(Component: any, props: any) { function preloadComponent(Component: any, props: any) {
const prev = console.error const prev = console.error
// Hide invalid hook call warning when calling component // Hide invalid hook call warning when calling component
console.error = (msg) => { console.error = function (msg) {
if (msg.startsWith('Invalid hook call..')) { if (msg.startsWith('Invalid hook call..')) {
// ignore // ignore
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment