While trying to kickstart my app I'm getting that both React or ReactDOM are undefined.
This is when using the es2015 import
syntax, preprocessed with babel.
Using the regular require
it loads fine.
The snippet is like this:
import $ from 'jquery';
import React from 'react';
import ReactDOM from 'react-dom';
import SearchForm from './utils/components.jsx';
$(function () {
var form = $('#search-form');
ReactDOM.render(<SearchForm />, form.get(0)); // react is undefined. raises InvariantViolation
})
Actual traceback reads like this:
Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Which looks like a react error, but using a breakpoint in the offending line (before ReactDOM
) and trying to evaluate both React
or ReactDOM
it returns undefined
, it's not the same for $ or any other import in the same module.
What gives?