Skip to content

Commit 551a229

Browse files
Fix: Typos in react component stub.
1 parent 89210c7 commit 551a229

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stubs/components/react/ts/infinite-scroll.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ interface InfiniteScrollProps {
1010

1111
type PageProps = {
1212
type: 'cursor' | 'paged';
13-
perPage: number;
14-
hasMore: boolean;
13+
per_page: number;
14+
has_more: boolean;
1515
cursor?: string;
1616
page?: number;
1717
};
1818

1919
type Payload = {
20-
perPage: number;
20+
per_page: number;
2121
cursor?: string;
2222
page?: number;
2323
};
@@ -32,8 +32,8 @@ type Payload = {
3232
*/
3333
function InfiniteScroll({ children, data, whileLoading, whileNoMoreData }: InfiniteScrollProps) {
3434
const page = usePage<PageProps>().props;
35-
const props: string[] = [data, 'type', 'perPage', 'hasMore'];
36-
const payload: Payload = { perPage: page.perPage };
35+
const props: string[] = [data, 'type', 'per_page', 'has_more'];
36+
const payload: Payload = { per_page: page.per_page };
3737
const [loading, setLoading] = useState<boolean>(false);
3838

3939
const loadData = () => {
@@ -61,7 +61,7 @@ function InfiniteScroll({ children, data, whileLoading, whileNoMoreData }: Infin
6161
<Deferred data={data} fallback={<>{whileLoading || <p className="text-center text-muted-foreground">Loading...</p>}</>}>
6262
{loading ? (
6363
<>{whileLoading || <p className="text-center text-muted-foreground">Loading...</p>}</>
64-
) : page.hasMore ? (
64+
) : page.has_more ? (
6565
<WhenVisible onVisible={loadData} />
6666
) : (
6767
<>{whileNoMoreData || <p className="text-center text-muted-foreground">No more data</p>}</>

0 commit comments

Comments
 (0)