The registration console for some objects does not work when developing a Firefox extension using React

A console registering certain objects, for example, this.refs or a window object, causes a TypeError: cyclic object value error in the terminal.

My code is pretty simple: I'm trying to change the html on a web page (by putting a responsive component in it).

Main.js:

 var pageMod = require("sdk/page-mod"); var self = require("sdk/self"); var { MatchPattern } = require("sdk/util/match-pattern"); // Create a page mod // It will run a script whenever a ".org" URL is loaded // The script replaces the page contents with a message pageMod.PageMod({ include: /.*wikipedia.org\/wiki\/.*/, contentScriptFile: [ self.data.url("react-with-addons.js"), self.data.url("testing.js"), ], contentScriptWhen: "ready", // contentStyleFile: self.data.url("style.css"), }); 

testing.js:

 var AppContainer = React.createClass({displayName: "AppContainer", componentDidMount: function() { console.log(this.refs.myRef); console.log(window); }, render: function() { console.log('rendering'); return ( React.createElement("div", {ref: "myRef"}) ); } }); React.render(React.createElement(AppContainer, null), document.getElementById('content')); 

After running cfx run logs in the cfx run component do not display anything in the browser console, and the cyclic object value displays (tries to register the window object in the console). Why is he having difficulty?

+7
reactjs firefox-addon firefox-addon-sdk
source share

No one has answered this question yet.

See related questions:

501
React Router URLs Do Not Work When Updating or Writing Manually
57
What is the easiest way to develop a Firefox extension?
8
Logging into the console from the Firefox extension?
3
Thunderbird Extension Console Logging
2
Firefox Extension: Access Window Elements
one
JS component reaction manifests itself several times in Meteor
one
Firefox extension works locally, but not on another computer
0
firefox extension: - pagemod not working
0
window.enableMouseFlow is not defined in componentDidMount (), but is available in render ()
0
Firefox add-ons: cfx run works fine, cfx xpi works, but the add-in does nothing

All Articles