syncfusion / JavaScript-Widgets

Syncfusion Essential JavaScript is a comprehensive collection of over 80+ enterprise-grade HTML5 JavaScript components for building modern web applications.
http://www.syncfusion.com/products/javascript
35 stars 36 forks source link

[Bug] ej.web.react.min, "createReactClass is not defined" #17

Open VRspace4 opened 6 years ago

VRspace4 commented 6 years ago

"syncfusion-javascript": "^15.4.17"

From the ej.web.react.min.js file located in syncfusion-javascript/Scripts/ej/common/, please change from createReactClass to React.createClass. Otherwise it'll prompt the following error:

Uncaught ReferenceError: createReactClass is not defined 
Ezhil-Git commented 6 years ago

Essential JS1 for React provided support for React v16.0+ from Volume 4, 2017. Find the updated getting started UG to add “create-react-class” package in application. https://help.syncfusion.com/reactjs/overview https://help.syncfusion.com/reactjs/release-notes/v15.4.0.17?type=all

To overcome the issue, you can refer the "create-react-class" script. Because changing the function call in ej.web.react.min.js will cause rendering issue with React v16.0+.

Rekeyea commented 5 years ago

For any who needs to know. The way to use this package with create-react-app is to do the following:

import React, { Component } from 'react';
import ReactDOM from "react-dom";
import createClass from "create-react-class";
import jquery from "jquery";

window.jQuery = jquery;
window.$ = jquery;
window.React = React;
window.ReactDOM = ReactDOM;
window.createReactClass = createClass;

require("jsrender");
require("syncfusion-javascript/Scripts/ej/web/ej.spreadsheet.min.js");
require("syncfusion-javascript/Scripts/ej/common/ej.web.react.min.js");
require("syncfusion-javascript/Content/ej/web/material/ej.web.all.min.css");

const EJ = window.EJ;
const ej = window.ej;

Having that it's possible to use the components as in the documentation