smart_garden_server/client/main.jsx

23 lines
603 B
JavaScript

import React from 'react';
import { Meteor } from 'meteor/meteor';
import ReactDOM from 'react-dom';
import App from '../imports/ui/App';
import 'bootstrap/dist/css/bootstrap.min.css';
export const PlantTypesCollection = new Meteor.Collection('plantTypes');
Meteor.startup(() => {
if(Meteor.isServer) {
Meteor.publish('plantTypesCollection', function() {
return PlantTypesCollection.find();
})
}
if (Meteor.isClient) {
Meteor.subscribe('plantTypesCollection');
}
Meteor.setTimeout(function() {
ReactDOM.render(<App />, document.getElementById('root'));
}, 500);
});