React Native: evaluate the headers builder when each request is sent (parity with #7510)
Author: BenTaylorDevCreated Sep 29, 2026Updated Sep 29, 2026
Labelsfeature request
#7510 makes a headers builder (sync or async) run when each request is sent, in React (CopilotKitProvider and <CopilotKit>), Vue and Angular.
@copilotkit/react-native's CopilotKitProvider still calls the builder during render, and accepts only the sync form. So an RN app with a short-lived token (for example Clerk's 60 s tokens) sends a stale token after it rotates without a provider re-render. That is the bug #1937 describes for the web.
Fix: mirror the React v2 provider. Hand core one stable wrapper, never evaluate the builder during render, and widen the prop type to CopilotKitHeadersSource. The docs already note RN's current limit (docs/frontends/react-native.mdx).
Source: CopilotKit/CopilotKit