Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

createCompositeComponent.stub.ts

20 lines675 Bytes

1import type {
2 CompositeComponentResult,
3 ValidateCompositeComponent,
4} from './ServerComponentTypes'
5​
6/**
7 * Client stub for createCompositeComponent.
8 *
9 * This function should never be called at runtime on the client.
10 * It exists only to satisfy bundler imports in client bundles.
11 * The real implementation only runs inside server functions.
12 */
13export function createCompositeComponent<TComp>(
14 _component: ValidateCompositeComponent<TComp>,
15): Promise<CompositeComponentResult<TComp>> {
16 throw new Error(
17 'createCompositeComponent cannot be called on the client. ' +
18 'This function should only be called inside a server function or route loader.',
19 )