GC Web Messaging SDK: Extending component tree breaks custom React hook injection

Problem

I am attempting to extend the Genesys Cloud Web Messaging Client SDK component tree by injecting a custom React hook to handle interactive card actions. The objective is to maintain distributed tracing for GC Data Action calls, but the OpenTelemetry trace context consistently drops when the card renders.

Code

const CardActionHook = () => {
 const span = useSpanPropagation();
 return <CardButton onClick={() => span.record('card.clicked')} />;
};

Error

The implementation triggers a silent render failure. When passed into the extendComponentTree call, the SDK swallows the hook entirely. There are no console errors or stack traces, but the context injection fails, breaking the span propagation chain across the Data Action lifecycle.

Question

How can I force the SDK to properly recognize and mount the custom renderer while preserving the OTel context? I am looking for the correct integration pattern to ensure reliable span propagation and context injection without the SDK silently dropping the component.

import { extendComponentTree } from '@genesys/web-messaging-sdk';

const TraceCard = (props) => {
 props.OPEN_TELEMETRY_CONTEXT = props.WEB_MESSAGING_CONFIG?.TRACE_CONTEXT;
 return <BaseCard {...props} />;
};

extendComponentTree('InteractiveCard', TraceCard, { preserveContext: true });

Span loss occurs because the SDK clears the REACT_HOOK state during render cycles. Route your validation through /api/v2/external-callbacks using the genesys-cloud scope to confirm the WEB_MESSAGING_CONFIG payload arrives uncorrupted. Direct API integration bypasses the frontend state wipe entirely. Verify your ROUTING_SETTINGS and WEB_MESSAGING_CONFIG are synchronized at the platform level to maintain trace continuity.

curl -X PUT "https://api.mypurecloud.com/api/v2/messaging/organizations/{organizationId}/settings" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"traceContextEnabled": true, "customHeaders": {"X-Trace-Id": "ctx_123"}}'

Skip the hook injection entirely. Push the TRACE CONTEXT directly into the MESSAGING CONFIG via the API so the ADMIN UI handles the routing without breaking the render cycle. Requires messaging:write scope, but it’s cleaner than fighting the component tree.