reactjs - React is undefined after import -


while trying kickstart app i'm getting both react or reactdom undefined. when using es2015 import syntax, preprocessed babel. using regular require loads fine. snippet this:

import $ 'jquery'; import react 'react'; import reactdom 'react-dom'; import searchform './utils/components.jsx'; $(function () {     var form = $('#search-form');     reactdom.render(<searchform />, form.get(0)); // react undefined. raises invariantviolation }) 

actual traceback reads this:

uncaught invariant violation: element type invalid: expected string (for built-in components) or class/function (for composite components) got: object. 

which looks react error, using breakpoint in offending line (before reactdom) , trying evaluate both react or reactdom returns undefined, it's not same $ or other import in same module.

what gives?


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -