CreateClass reported an error

the project uses create-react-app scaffolding to frame the project. I just want to practice simply, but I didn"t expect to report an error. The code is as follows:

import React from "react";
import ReactDOM from" react-dom";
import". / index.css";
/ / import App from". / App";
import registerServiceWorker from". / registerServiceWorker";

var Card = React.createClass ({

)
render: function() {
  return (
    <div>

123

</div> ) }

});
ReactDOM.render (< Card / >, document.getElementById ("root"));
registerServiceWorker ();

)

errors are as follows:

TypeError: _ WEBPACK_IMPORTED_MODULE_0_react_default.a.createClass is not a function
. / src/index.js
C:/Users/MatCloud/Desktop/mutest/test-react/src/index.js:7
4 | / / import App from". / App";
5 | import registerServiceWorker from". / registerServiceWorker";
6 |

7 | var Card = React.createClass ({
8 | render: function () {
9 | return (
10 |

123

< / div >
View compiled
render: function () 6 stack frames were collapsed.
Mar.03,2021

React.createClass is not recommended in React@15.5.0 , but ES6 class

is recommended.

Functional and Class Components

// 
class Card extends React.Component {
    render(){
       return(
           <div>

123

</div> ) } } // const Card = () => <div>

123

</div>;

from-reactcreateclass" rel=" nofollow noreferrer "or alternative:

// Before (15.4 and below)
var React = require('react');

var Component = React.createClass({
  mixins: [MixinA],
  render() {
    return <Child />;
  }
});

// After (15.5)
var React = require('react');
var createReactClass = require('create-react-class');

var Component = createReactClass({
  mixins: [MixinA],
  render() {
    return <Child />;
  }
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3578f-2b7e2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3578f-2b7e2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?