Skip to content

Commit

Permalink
feat: pass extra porps to component
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalchavhan committed Apr 11, 2024
1 parent c1ab710 commit 5ae6837
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component/createServerComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ export function preloadServerComponent({ global = defaultGlobal }: RSCConfig) {
export const ServerComponent = ({
global = defaultGlobal,
source,
onAction,
...extras
}: RSCProps): JSX.Element | null => {
const { Component } = React.useMemo(() => {
return createServerComponent({ global });
}, [global]);

if (source && Component) {
return <Component source={source} onAction={onAction} />;
return <Component source={source} {...extras} />;
}
return null;
};

0 comments on commit 5ae6837

Please sign in to comment.