Closed unitof closed 4 months ago
Out of the box (on next@14), the app router example code fails to build with a Type error, since searchParams can be null:
searchParams
null
./app/Fathom.tsx:25:23 Type error: 'searchParams' is possibly 'null'. 23 | 24 | trackPageview({ > 25 | url: pathname + searchParams.toString(), | ^ 26 | referrer: document.referrer 27 | }); 28 | }, [pathname, searchParams]); Error: Command "npm run vercel-build" exited with 1
This allows for that with the optional chaining ?. operator.
?.
Thanks @unitof!
Out of the box (on next@14), the app router example code fails to build with a Type error, since
searchParams
can benull
:This allows for that with the optional chaining
?.
operator.