File tree Expand file tree Collapse file tree
tests/integration/rsc-mf/host/src/server-component-root Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use client' ;
22
3- import { useState } from 'react' ;
3+ import { useEffect , useState } from 'react' ;
44import RemoteClientBadge from 'rscRemote/RemoteClientBadge' ;
55import { RemoteClientCounter as RemoteClientCounterBridge } from 'rscRemote/RemoteClientCounter' ;
66import { remoteActionEcho } from 'rscRemote/actions' ;
77import defaultRemoteAction from 'rscRemote/defaultAction' ;
8+ import { registerRemoteServerCallback } from 'rscRemote/registerServerCallback' ;
89
910export 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 {
You can’t perform that action at this time.
0 commit comments