React view isomorph with socket.io for sailsjs
npm install sails-react-store
Sails React
``sh`
$ npm install sails-react-store sails-hook-babel --save
js
"use strict";
import React from 'react'
import {ReactItem, ReactCollection} from 'sails-react-store'export class PostItem extends ReactItem {
render() {
return (
{this.state.item.title}
{this.state.item.content}
)
}
}//
//
class Item {
render() {
return (
{this.props.item.title}
)
}
}
export class PostCollection extends ReactCollection {
render() {
return (
{this.state.items.map( (item,i) => {
return ;
})}
)
}
}
`
and use like that
when no attributes items => get request /post
`js
`
or if you want to add manually items
`js
`
$3
`js
``MIT © 2015 contributors