-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hello,
That's the first time I try to use an external component, and I have this error when lauching it.
Uncaught TypeError: React.createClass is not a function
at Object../node_modules/react-icon-rating/index.js (index.js:4)
at webpack_require (bootstrap af908a3931df895eba00:678)
at fn (bootstrap af908a3931df895eba00:88)
at Object../src/App.js (App.css?9a66:26)
at webpack_require (bootstrap af908a3931df895eba00:678)
at fn (bootstrap af908a3931df895eba00:88)
at Object../src/index.js (index.css?f255:26)
at webpack_require (bootstrap af908a3931df895eba00:678)
at fn (bootstrap af908a3931df895eba00:88)
at Object.0 (registerServiceWorker.js:108)
at webpack_require (bootstrap af908a3931df895eba00:678)
at ./node_modules/ansi-regex/index.js.module.exports (bootstrap af908a3931df895eba00:724)
at bootstrap af908a3931df895eba00:724
I tried to follow the steps to install everything correctly but it's still wrong. Could you help me ?
Here is my code :
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
var IconRating = require('react-icon-rating')
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<IconRating toggledClassName="fa fa-star" untoggledClassName="fa fa-star-o"/>
</div>
);
}
}
export default App;