Skip to content

Instantly share code, notes, and snippets.

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

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')
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

This comment has been minimized.

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