chore: added useSubscribe to react skeleton

This commit is contained in:
Gabriel Grubba
2023-01-30 11:21:30 -03:00
parent c6bfed9c0a
commit 8045ad9aac

View File

@@ -1,11 +1,14 @@
import React from 'react';
import { useTracker } from 'meteor/react-meteor-data';
import { useFind, useSubscribe } from 'meteor/react-meteor-data';
import { LinksCollection } from '../api/links';
export const Info = () => {
const links = useTracker(() => {
return LinksCollection.find().fetch();
});
const isLoading = useSubscribe('links');
const links = useFind(() => LinksCollection.find());
if(isLoading()) {
return <div>Loading...</div>;
}
return (
<div>