Open maixing opened 6 years ago
This is a pretty common issue when using packages that aren't updated for React 16. React took out the createClass function in version 16. You can get the code to work using the following workaround with the create-react-class package (yarn add create-react-class
or npm install create-react-class
- depending on your package manager):
import React from 'react'
React.createClass = require('create-react-class')
const Form = require('react-json-editor')
... do your thing here...
Is there a planned update to solve the issue?
Make a pull request importing create-react-class @mrovinsky and it might solve the issue.
in React16 react-json-editor.js:436 Uncaught (in promise) TypeError: React.createClass is not a function at Object. (react-json-editor.js:436)
at webpack_require (react-json-editor.js:30)
at Object. (react-json-editor.js:417)
at webpack_require (react-json-editor.js:30)
at Object.module.exports (react-json-editor.js:97)
at webpack_require (react-json-editor.js:30)
at Object. (react-json-editor.js:83)
at webpack_require (react-json-editor.js:30)
at react-json-editor.js:50
at react-json-editor.js:53