Last active
August 18, 2017 22:57
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that
react-nestable
doesrequire('./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...