We created a widget that runs on React within the Dojo framework in Mendix, it is based on the blogpost written in January: https://www.mendix.com/blog/using-react-mendix-widgets/
All went well with development and the widget works fine - as long as it runs on a local machine. Whenever we deploy the app to a cloud slot, it will not load. It won't include the react.js and react-dom.js files in the deployment for some reason and therefor the widget won't work and throws the following error:
Error: ServiceDeskPlanning_widget_ServiceDeskPlanning_0.applyContext: Error: ServiceDeskPlanning_widget_ServiceDeskPlanning_0.applyContext: TypeError: React.createElement is not a function
If we run a Check Widgets (via Tools), it reports: All widgets build correctly.
Both react.js and react-dom.js are included in the following way in every file that uses React:
define(["OurApp/widget/lib/react","OurApp/widget/lib/react-dom",
], function(React, ReactDOM){
//Widget code here
});