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
This comment has been minimized.
timwis commentedAug 18, 2017
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...