shadow cljs jsx file - react index default is undefined

Skip to first unread message

Scott Klarenbach

Apr 25, 2020, 1:57:59 PM4/25/20
to ClojureScript
I'm following the instructions from here: to get jsx flies compiled through babble and required in clojurescript, but I keep getting the error: react index default is undefined

Is this an npm/react issue?  I only have one react installed for the project.

scott klarenbach

Thomas Heller

Apr 26, 2020, 6:07:05 AM4/26/20
to ClojureScript
I'm assuming you are trying a .js file that has

   import React from "react";

This would try to access the default export of react. Since react only ships CommonJS it has no default export. CommonJS and ESM interop is in a weird spot currently and a bit ugly.

  import * as React from "react";

This should be fine.
Reply all
Reply to author
0 new messages