        :component-did-update reset-trigger-point!
 
        :reagent-render
-       (fn [child-el opts]
+       (fn [opts child-el]
          (reset! options opts)
          child-el)}))))
 

(defn- get-offset-position [node offset]
  (cond
    (number? offset)  offset
    (string? offset)  (as-percentage (.innerHeight node) offset)
    (fn? offset)      (offset node)
    :else             0))


  (fn [this]
    (swap! waypoints assoc-in
           [id :trigger-point]
           (get-node-position-at-offset (reagent/dom-node this) (:offset @options)))))

(defn waypoint
  ([child-el] (waypoint {} child-el))
