 
   renderHTMLCode: () ->
     path = @editor.getPath()
-    tmpFile = tmpDir + '/tmpReactComponent.js'
+    window.editor = @editor
+    # TODO remove this file when closing...
+    tmpFile = path + '.reactpreview.tmp'
     if not atom.config.get("atom-react-preview.triggerOnSave") and @editor.getPath()? then @save () =>
       iframe = document.createElement("iframe")
       # Fix from @kwaak (https://github.com/webBoxio/atom-html-preview/issues/1/#issxuecomment-49639162)

find_component_proptypes = require('./find_component_proptypes')
renderer = require('./renderer')
window.find_component_proptypes = find_component_proptypes
tmpDir = os.tmpdir()

module.exports =
class AtomReactPreviewView extends ScrollView


      try
        # TODO WHAT?! Why require places the cache in /private? Who knows...
        delete require.cache[tmpFile]
        subcomponent_to_render = React.createElement(require(tmpFile), @componentState)
      catch err
        atom.notifications.addError('Error parsing React component!', {detail: 'Something went wrong rendering your component "'+@editor.getTitle()+'"\n\n\nCheck for syntax-errors.\n\n\n Full Message:\n\n\n' + err.toString(), dismissable: true})
