Is it possible to run React within an Atom package?
I keep getting a React error indicating that the Atom views are not DOM elements.
Invariant Violation: _registerComponent(...): Target container is not a DOM element.
In this case I’m simply running a basic React demo within the view.coffee generated file
React = require 'react'
module.exports =
class ReactTestView
constructor: ->
@element = document.createElement('div')
@element.setAttribute 'id', 'react-render'
Component = React.createClass
displayName: 'Component'
render: ->
React.DOM.div("Hello #{@props.name}!")
component = React.createFactory(Component)
React.render(component(name: "World"), document.getElementById 'react-render')
I understand React is no longer used in Atom, but I would like to create a plugin of significant complexity.
If it can’t work, alternatively, does anyone know of an example using a variant of Flux with Space-Pen? Possibly utilizing atoms event emitters.