By default, tRPC will retain its own reference to window.fetch on init. Any changes to or replacements of window.fetch would not be picked up by tRPC, which will affect eg, instrumentation by Datadog RUM.
Solution
Fix this by supplying our own fetch implementation that delegates to whatever is the current global fetch().
Problem
By default, tRPC will retain its own reference to window.fetch on init. Any changes to or replacements of window.fetch would not be picked up by tRPC, which will affect eg, instrumentation by Datadog RUM.
Solution
Fix this by supplying our own fetch implementation that delegates to whatever is the current global
fetch()
.