Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: React.createClass is not a function #14

Open
redouane59 opened this issue Nov 30, 2017 · 0 comments
Open

TypeError: React.createClass is not a function #14

redouane59 opened this issue Nov 30, 2017 · 0 comments

Comments

@redouane59
Copy link

redouane59 commented Nov 30, 2017

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant