Sha256: d2c53bdcd195d3f3c5acdd590523b8fa9ef3c7750d3aad3bc0f8c06509384b6f
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
import React from 'react' import ReactDOM from 'react-dom' export default class ReactComponentRenderer { constructor(klass, container) { this.klass = klass; this.container = container; this.props = {}; this.component = null; } replaceProps(props, callback) { this.props = {}; this.setProps(props, callback); } setProps(partialProps, callback) { if (this.klass == null) { console.warn( 'setProps(...): Can only update a mounted or ' + 'mounting component. This usually means you called setProps() on ' + 'an unmounted component. This is a no-op.' ); return; } Object.assign(this.props, partialProps); var element = React.createElement(this.klass, this.props); this.component = ReactDOM.render(element, this.container, callback); } unmount() { debugger ReactDOM.unmountComponentAtNode(this.container); this.klass = null; } }
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lanes-0.8.3 | client/lanes/renderer.js |
lanes-0.8.2 | client/lanes/renderer.js |
lanes-0.8.1 | client/lanes/renderer.js |
lanes-0.8.0 | client/lanes/renderer.js |