Skip to content

Commit 956df99

Browse files
committed
fix(rsc-mf): register callback for federated action runtime copy
1 parent 935b201 commit 956df99

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/integration/rsc-mf/host/src/server-component-root/HostRemoteActionRunner.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use client';
22

3-
import { useState } from 'react';
3+
import { useEffect, useState } from 'react';
44
import RemoteClientBadge from 'rscRemote/RemoteClientBadge';
55
import { RemoteClientCounter as RemoteClientCounterBridge } from 'rscRemote/RemoteClientCounter';
66
import { remoteActionEcho } from 'rscRemote/actions';
77
import defaultRemoteAction from 'rscRemote/defaultAction';
8+
import { registerRemoteServerCallback } from 'rscRemote/registerServerCallback';
89

910
export default function HostRemoteActionRunner() {
1011
// Keep this import in the client graph so federated RSC bridge IDs
@@ -14,6 +15,10 @@ export default function HostRemoteActionRunner() {
1415
const [echoResult, setEchoResult] = useState('');
1516
const [isPending, setIsPending] = useState(false);
1617

18+
useEffect(() => {
19+
registerRemoteServerCallback(window.location.origin);
20+
}, []);
21+
1722
const runActions = async () => {
1823
setIsPending(true);
1924
try {

0 commit comments

Comments
 (0)