Reactive with react and meteor

If you been working with react and meteor, you will realised that both are reactive by nature of its framework/library, but when bridge them together, it does not work well in reactive way.

fortunately Meteor team created a package called React Meteor Data. 

To use React-Meteor-Data which is pretty easy,

you just need to install to your meteor folder

meteor add react-meteor-data

and import to your current react component as usual:

import { createContainer } from 'meteor/react-meteor-data';

You just need to use createContainer function to wrap your component as example below:

  export class LowerOrderComponent extends Component {
    render() {
      const {user} = this.props; // user is a prop from container and is reactive now
      return(
       
{user}
) } } export default createContainer(() => { // you can subscribe something here return { user: Meteor.user(), }; }, LowerOrderComponent);

thats how easy you use reactive feature with react and meteor.