Using React.js to write my own plugin


#1

Hi Guys,

As I say, I want to using React.js to replace the view layer space-pen in my package. But I found a problem when I try to using React.js as the dependency in my module. It throws some error like this:

Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings. /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/invariant.js:42invariant /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/invariant.js:42getID /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactMount.js:86ReactMount.isRenderedByReact /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactMount.js:564ReactMount.getFirstReactDOM /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactMount.js:579handleTopLevelImpl /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventListener.js:70Mixin.perform /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/Transaction.js:141ReactDefaultBatchingStrategy.batchedUpdates /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactDefaultBatching…:70batchedUpdates /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactUpdates.js:113ReactEventListener.dispatchEvent /Applications/Atom.app/Contents/Resources/app/node_modules/react-atom-fork/lib/ReactEventListener.js:186

Well, what I know is that atom using it’s own fork of react as react-atom-fork. But I don’t know how I can deal with these kind of issues. Or I shouldn’t using React.js to write my plugin …


#2

React is also being phased out for most uses. It’s all about web components now like custom elements and dom shadowing. I’m just now starting to wrap my head around it.


#3

Hi Mark,

I know web component will be the next thing will be adopted, but I can use custom element and shadow dom to wrap my React component right? I think the reason why I want to use React.js is not only the component itself, it’s about performance and provide a simpler view layer(for myself).

Thanks