Meteor with Modern Front-End Frameworks

Meteor can be integrated with modern front-end frameworks like React, Vue, or Angular.

React Example:

meteor add react-meteor-data

React Component:

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { Items } from '../imports/api/items';

const App = ({ items }) => (
  <div>
    <h1>Items</h1>
    <ul>
      {items.map(item => <li key={item._id}>{item.name}</li>)}
    </ul>
  </div>
);

export default withTracker(() => {
  Meteor.subscribe('items');
  return {
    items: Items.find().fetch()
  };
})(App);

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *