Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
roderickhsiao committed Dec 26, 2024
1 parent 14f15ef commit 6151a35
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lib/handleViewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function handleViewport<
>(
TargetComponent: ComponentType<PropsWithoutRef<TProps>>,
options: Options = defaultOptions,
config: Config = defaultConfig
config: Config = defaultConfig,
) {
const ForwardedRefComponent = forwardRef<TElement, TProps>((props, ref) => {
const refProps = {
Expand Down Expand Up @@ -54,10 +54,9 @@ function handleViewport<
return <ForwardedRefComponent {...props} ref={node} />;
};

const name =
(TargetComponent as React.FC).displayName ||
(TargetComponent as React.FC).name ||
'Component';
const name = (TargetComponent as React.FC).displayName
|| (TargetComponent as React.FC).name
|| 'Component';
InViewport.displayName = `handleViewport(${name})`;

return hoistNonReactStatic(InViewport, ForwardedRefComponent);
Expand Down

0 comments on commit 6151a35

Please sign in to comment.