React.js with XUL for Firefox development

338 views Asked by At

React.js was designed to work with HTML. How about XUL, sort of HTML? When I tried to run them together I got an error: Target container is not a DOM element.

Basically I don't see the reason why React.js shouldn't work with XUL. I would like to hear some opinions or suggestions for this subject.

1

There are 1 answers

0
Paul Sweatte On

React.js tests for the DOM as follows:

var canUseDOM = !!(
 typeof window !== 'undefined' &&
 window.document &&
 window.document.createElement
);

whereas XUL works as follows:

You can get a Window object from a document using document.defaultView.

Assume you have a document loaded in a <tabbrowser>, <browser>, or <iframe> element inside your document. You can use browser.contentDocument to access that document and browser.contentWindow to access the Window object of that document.

References