Skip to content

Require react directly #165

Closed
Closed
@filipesilva

Description

Hi there,

Devcards seems to depend on the global React instead of requiring it directly. When using https://github.com/thheller/shadow-cljs with Devcards, you need to directly import cljsjs.react and cljsjs.react.dom before importing devcards.core, otherwise it will error out at runtime:

  (:require [cljsjs.react]
            [cljsjs.react.dom]
            ; devcards needs cljsjs.react and cljsjs.react.dom to be imported
            ; separately for shadow-cljs to add shims.
            [devcards.core :refer [start-devcard-ui!]]
            ...

If devcards imports React directly instead, it should work though:

(:require ["react" :as react])

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions