React wrapper for gridstack.js
npm install react-gridstackWrapper library for GridStack.
npm install react-gridstack
To use this package in the browser, clone this repo and run gulp build. Then,
copy the react-gridstack.min.js and react-gridstack.min.css files from thedist directory and include them in your html head. Note that this files
include jQuery, jQuery-UI and lodash.
js
import React from 'react'
import { GridStack, GridStackItem } from 'react-gridstack'class MyGrid extends React.Component {
render () {
First Item
Second Item
}
}
`Make sure to include the css file in your bundle.
Options
Aside from all the (options)[https://github.com/troolee/gridstack.js/tree/master/doc] accepted by
gridstack.js, the following props can be also passed to the components.
$3
* onShouldUpdate(prevElement, newElement): Function to be called with the
previous prop version and new prop version of the element. It must return
true or false to indicate if the element should be re-rendered. Very
similar in function to shouldComponentUpdate` from react.See anything missing? Fork, implement and submit a pull request.
See the license file.