Skip to content

Instantly share code, notes, and snippets.

@timwis
Last active August 18, 2017 22:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save timwis/ec8c1618e29ca71c83cd2e63ea8813c6 to your computer and use it in GitHub Desktop.
const Nestable = require('react-nestable').default
const React = require('react')
const ReactDOM = require('react-dom')
const Nanocomponent = require('nanocomponent')
const css = require('sheetify')
css('react-nestable/dist/Nestable/Nestable.css')
css('react-nestable/dist/Icon/Icon.css')
module.exports = class TaskList extends Nanocomponent {
createElement (tasks) {
const el = document.createElement('div')
const renderItem = ({ item }) => item.title
const props = { items: tasks, renderItem }
const nestable = React.createElement(Nestable, props)
ReactDOM.render(nestable, el)
return el
}
}
@timwis
Copy link
Author

timwis commented Aug 18, 2017

Note that react-nestable does require('./Nestable.css') which breaks the browserify build. I had to comment that out, but there's probably a way to do that with a browserify global transform or something...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment