File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 2121; ; this channel is only used for card registration notifications
2222(defonce devcard-event-chan (chan ))
2323
24+ (def react-element-type-symbol
25+ " Make a react Symbol the same way as React 0.14"
26+ (or (and (exists? js/Symbol)
27+ (fn? js/Symbol)
28+ (aget js/Symbol " for" )
29+ ((aget js/Symbol " for" ) " react.element" ))
30+ 0xeac7 ))
31+
2432; ; its possible to record the meta-data for the loaded ns's being
2533; ; shipped by figwheel, by ataching a before load listener and storing
2634; ; the meta data, might be better to have figwheel do that.
358366 :value x})))
359367
360368(defn react-element? [main-obj]
361- (aget main-obj " _isReactElement" ))
369+ (or (aget main-obj " _isReactElement" ) ; ; react 0.13
370+ (= react-element-type-symbol ; ; react 0.14
371+ (aget main-obj " $$typeof" ))))
362372
363373(defn validate-card-options [opts]
364374 (if (map? opts)
Original file line number Diff line number Diff line change 412412(defn start-ui-with-renderer [channel renderer]
413413 (defonce devcards-ui-setup
414414 (do
415- (js/React.initializeTouchEvents true )
415+ (when (exists? js/React.initializeTouchEvents)
416+ (js/React.initializeTouchEvents true ))
416417 (go
417418 (<! (load-data-from-channel! channel))
418419
434435(defn start-ui [channel]
435436 (defonce devcards-ui-setup
436437 (do
437- (js/React.initializeTouchEvents true )
438+ (when (exists? js/React.initializeTouchEvents)
439+ (js/React.initializeTouchEvents true ))
438440 (render-base-if-necessary! )
439441 (go
440442 ; ; initial load
You can’t perform that action at this time.
0 commit comments