I am trying to get react-loader to work with my react component.
I currently have the following snippet:
var Loader = require('react-loader');
var DisplayController = React.createClass({
getInitialState: function(){
return {
active_tab: 0,
tabs: [],
groupsData: {
objects: [{sub_groups:[]}]
},
itemsData: {objects: []},
active_sub_tab: "Most Recent",
loaded :false
};
},
componentDidMount: function() {
this.getGroupsApi();
this.getItemsApi();
},
render: function() {
return (<Loader loaded={this.state.loaded}> <MainMenu/> </Loader>);
}
});
When I added this code, it started giving me the following error:
Unfixed error: Invariant violation: addComponentAsRefTo (...): only ReactOwner can have links. This usually means that you are trying to add a reference to a component that does not have an owner (that is, it was not created inside another component render). Try to make this component inside a new top-level component that will hold back.
I follow the instructions of the module, why should I get this error?
source
share