Skip to content

Commit 9aca4b3

Browse files
committed
removed deprecated forwardRef from example
1 parent e3dbf52 commit 9aca4b3

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

apps/demo/src/components/list.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { forwardRef } from 'react';
2-
31
type ListProps = {
42
direction?: 'vertical' | 'horizontal';
53
children: React.ReactNode;
@@ -22,14 +20,16 @@ export function ListItem(props: ListItemProps) {
2220
return <li className="border bg-slate-200 p-4" {...props} />;
2321
}
2422

25-
export const Loading = forwardRef<React.ComponentRef<'div'>, unknown>(
26-
function Loading(props, ref) {
27-
return (
28-
<div ref={ref} className="p-1">
29-
<div className="animate-pulse bg-slate-600 p-4 text-white">
30-
Loading...
31-
</div>
23+
type LoadingProps = {
24+
ref: React.Ref<HTMLDivElement>;
25+
};
26+
27+
export function Loading({ ref }: LoadingProps) {
28+
return (
29+
<div ref={ref} className="p-1">
30+
<div className="animate-pulse bg-slate-600 p-4 text-white">
31+
Loading...
3232
</div>
33-
);
34-
},
35-
);
33+
</div>
34+
);
35+
}

0 commit comments

Comments
 (0)