react-semantic-ui icon indicating copy to clipboard operation
react-semantic-ui copied to clipboard

"React is not defined"

Open davidguttman opened this issue 10 years ago • 4 comments

Using react-semantic-ui like this:

var React = require('react')
var rsui = require('react-semantic-ui')(React)

Causes: Uncaught ReferenceError: React is not defined (common.js:2)

// common.js
var cache = { id: 0 },
    reactBackboneAware = !!React.mixins.exists('modelFieldValidator');

davidguttman avatar Apr 04 '15 22:04 davidguttman

I got the same error, After I defined the

var React = global.React = require('react');
var rsui = require('react-semantic-ui')

I got the 'exist' not defined error.

dujuanxian avatar May 10 '15 07:05 dujuanxian

Did you solve this issue, @dujuanxian? I have the same problem.

tvogels avatar Sep 14 '15 10:09 tvogels

I suffer from this too. I'm using ES6. I tried:

import React from 'react';
import rsui from 'react-semantic-ui';
console.log(rsui(React));

But I too get ReferenceError: React is not defined :(

peterbe avatar Oct 09 '15 23:10 peterbe

Even im facing the same issue. using ES6 with React 14 and webpack. everything is working in the ES5 version. But after converting all files to es6 i get React is not defined :(

Here is my git repo. https://github.com/gurusubramaniam/reactSample

gurusubramaniam avatar Dec 17 '15 06:12 gurusubramaniam