Skip to content

Instantly share code, notes, and snippets.

@timwis timwis/nestable.js
Last active Aug 18, 2017

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.