Answer the question
In order to leave comments, you need to log in
How to set up require.ensure?
require.ensure([], function(require) { require('./Facility'); }, 'Facility');
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of `NonPatientSer`
Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `NonPatientSer`.
Answer the question
In order to leave comments, you need to log in
did this and it works, but when reloading the page, it gives an error accessing
and the files are already on the server, .... but it works
componentDidMount(){
var Facility;
require.ensure([], function(require) {
Facility = require('./Facility').default;
render(<Facility/>, document.getElementById('fl'));
}, 'facility');
}
render() {
return (
<div>
<div id="fl"></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question