meteor/meteor-reactjs

Name: meteor-reactjs

Owner: Meteor

Description: ReactJS + addons + JSX (--harmony) for Meteor

Created: 2015-04-21 22:24:14.0

Updated: 2015-09-16 14:42:04.0

Pushed: 2015-04-21 06:50:44.0

Homepage:

Size: 350

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

meteor-reactjs

Join the chat at https://gitter.im/hipertracker/meteor-reactjs

Meteor smart package integrating React for both client and the server, to complement or replace the default Blaze templating system. React.addons are enabled. JSX is using ES6 transforms (–harmony) as well.

Usage

Inside your Meteor project, add the package:

teor add hipertracker:reactjs
How it works

The package exposes a special ReactMeteor.Mixin object that can be used to enable reactive data fetching for your React components.

To add the ReactMeteor.Mixin to a React component, simply include it in the mixins class property:

MyComponent = React.createClass({
xins: [ReactMeteor.Mixin],

 Make sure your component implements this method.
tMeteorState() {
return {
  foo: Session.get("foo"),
  ...
};


The getMeteorState method should return an object of properties that will be accessed via this.state in the component's render method or elsewhere. Dependencies will be registered for any data accesses performed by getMeteorState so that the component can be automatically re-rendered whenever the data changes.

You can find some examples at hipertracker/meteor-reactjs-examples.

Credits

The source code is based on reactjs/react-meteor. It has been updated to the latest Meteor and React version with enabled ES6 transforms for JSX files (–harmony).


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.