index.js 489B

123456789101112131415161718192021
  1. import React from 'react'
  2. import ReactDOM from 'react-dom'
  3. import PageHtml from './container/PageHtml.jsx'
  4. require('./css/index.styl')
  5. const appInterface = {
  6. renderApp: (domId, data) => {
  7. return ReactDOM.render(
  8. <PageHtml file={data} />
  9. , document.getElementById(domId)
  10. )
  11. },
  12. hideApp: domId => {
  13. // TODO: should be a display none
  14. return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
  15. }
  16. }
  17. module.exports = appInterface