I ran into an issue getting a simple Capybara/Poltergeist feature test suite running against a site that used React.js. The following failure was bubbling up to RSpec.
Failures:
I ran into an issue getting a simple Capybara/Poltergeist feature test suite running against a site that used React.js. The following failure was bubbling up to RSpec.
Failures:
package scalax.collection | |
import scala.collection.mutable.ListBuffer | |
/** FoldTransformers and the views based on them are a Scala | |
* adaptation, and to some degree an extension, of Rich Hickey's | |
* transducers for Clojure. They show that the concepts can be | |
* implemented in a type-safe way, and that the implementation is | |
* quite beautiful. | |
*/ | |
object FoldingViews { |
(ns history | |
"Light wrappers and utils for js/history") | |
(defn back! [] (.back js/history)) | |
(defn forward! [] (.forward js/history)) | |
(defn go! [idx] (.go js/history idx)) | |
(defn replace-state! |
;; from leiningen, use [dorothy/dorothy "0.0.3"] | |
(require '[dorothy.core :as dot]) | |
;; dataflow copied from chat | |
;; https://github.com/pedestal/samples/blob/master/chat/chat-client/app/src/chat_client/behavior.clj | |
(def dataflow '{:transform | |
{:outbound {:init {} :fn outbound-transform} | |
:inbound {:init {} :fn inbound-transform} | |
:nickname {:init nil :fn nickname-transform}} | |
:effect {:outbound send-message-to-server} |
Talk by John De Goes
Halogen is a Purescript UI framework in the spirit of React (but doesn’t wrap React) with the goal of expressing UIs in a declarative and type-safe way.
FRP (in typed languages) typically needs “reactive” data types to be parameterized over the type of the things they “produce” so the FRP machinery can control how values of that type get passed around. In the more React-y style, events are supported somehow internally by the main UI data type (so don’t need to be parameterized in that way).
(ns spec-test.core | |
(:require [clojure.spec :as s])) | |
(defn x-integer? [x] | |
(if (integer? x) | |
x | |
(if (string? x) | |
(try | |
(integer/parseint x) | |
(catch exception e |
(require '[datomic.api :as d]) | |
(def conn-uri "datomic:dev://localhost:4334/my-db") | |
;; This is normally how you would get a list of tx-ids outside a query. | |
;; However, there is some concern that this is not lazy. (I am pretty sure, | |
;; but not certain, that reading the tx-log is lazy.) | |
(-> conn-uri d/connect d/log (d/tx-range nil nil) | |
(->> (map :t) (take 10))) |
(ns ordering) | |
;;We want to pack some information along with | |
;;our functions so that when our interpreter picks them | |
;;up, we can determine if the function should be applied | |
;;directly as a comparator, or if we need to "lift" | |
;;it into the comparator domain. | |
(defn ordering? [x] (get (meta x) :ordering)) | |
;;convenience macro to help us create functions with | |
;;ordering specified in meta |
# Add these to your .bash_profile / .zshrc / etc. | |
# Starts a Clojure repl | |
function rebel-clj() { | |
clojure -Sdeps "{:deps {com.bhauman/rebel-readline {:mvn/version \"0.1.4\"} $@}}" -m rebel-readline.main | |
} | |
# Starts a browser REPL | |
function rebel-cljs() { | |
clojure -Sdeps "{:deps {com.bhauman/figwheel-main {:mvn/version \"0.1.7\"} com.bhauman/rebel-readline-cljs {:mvn/version \"0.1.4\"} $@}}" -m figwheel.main |
You are probably here because you got the following error messages:
addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's
render
method, or you have multiple copies of React loaded.
This usually means one of two things:
ref
to an element that is being created outside of a component's render() function.Invalid Refs