mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
chore: added useSubscribe to react skeleton
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user