This React wrapper has a few concerns:
This React wrapper has a few concerns: - Build React component and delegate lifecycle methods to supplied cljs functions - Provide functions to update internal component state - Provide render functions
(assoc! component & kvs)
Replaces values in the component's local state. Delegates to clojurescript's assoc
Replaces values in the component's local state. Delegates to clojurescript's assoc
(assoc-in! component ks v)
Replaces a value in the component's local nested associative state, where ks is a sequence of keys and v is the new value. If any levels do not exist, hash-maps will be created. Delegates to clojurescript's assoc-in.
Replaces a value in the component's local nested associative state, where ks is a sequence of keys and v is the new value. If any levels do not exist, hash-maps will be created. Delegates to clojurescript's assoc-in.
(component & forms)
Build anonoymous component class
Build anonoymous component class
(defcomponent name & forms)
Defines a fn to create a React component
Defines a fn to create a React component
(dissoc! component k & ks)
Dissociates entries from the component's nested associative structure. Can accept multiple keys to remove. Delegates to clojurescript's dissoc
Dissociates entries from the component's nested associative structure. Can accept multiple keys to remove. Delegates to clojurescript's dissoc
(dissoc-in! component ks)
Dissociates an entry from the component's nested associative structure. ks can be a sequence of keys.
Dissociates an entry from the component's nested associative structure. ks can be a sequence of keys.
(force-update! component)
(force-update! component cb)
Forces an update. This should only be invoked when it is known with certainty that we are not in a DOM transaction.
You may want to call this when you know that some deeper aspect of the component's state has changed but any state change functions were not called.
This will not invoke should-update
, but it will invoke will-update
and
did-update
.
Forces an update. This should only be invoked when it is known with certainty that we are **not** in a DOM transaction. You may want to call this when you know that some deeper aspect of the component's state has changed but any state change functions were not called. This will not invoke `should-update`, but it will invoke `will-update` and `did-update`.
(get-node component)
(get-node component name)
Get the node of the current component, or if a name is passed in, lookup any refs that have been declared on child dom elements
Get the node of the current component, or if a name is passed in, lookup any refs that have been declared on child dom elements
(get-props component)
(get-props component ks)
Returns the value of the components inherited nested associative structure. ks is an optional property that gives quick access to a get-in call
Returns the value of the components inherited nested associative structure. ks is an optional property that gives quick access to a get-in call
(get-state component)
(get-state component ks)
Returns the value of the components owned state nested associative structure. ks is an optional property that gives quick access to a get-in call
Returns the value of the components owned state nested associative structure. ks is an optional property that gives quick access to a get-in call
(render-to-dom component dom)
Bootstrap the component and inject it into the dom on the next render cycle
Bootstrap the component and inject it into the dom on the next render cycle
(render-to-static-markup element)
Render a React element to its initial HTML, except this doesn’t create extra DOM attributes that React uses internally
Render a React element to its initial HTML, except this doesn’t create extra DOM attributes that React uses internally
(render-to-string element)
Render a React element to its initial HTML
Render a React element to its initial HTML
(reset! component val)
Sets the new value of the components state to val without regard to the current value. Takes optional callback function to be called when value is merged into the render state
Sets the new value of the components state to val without regard to the current value. Takes optional callback function to be called when value is merged into the render state
(swap! component f & args)
Apply f over the state of the included component. Use this if you want to make multiple changes to the state of your component
Apply f over the state of the included component. Use this if you want to make multiple changes to the state of your component
(update! component k f & args)
Update a value in the component's local show structure.
Update a value in the component's local show structure.
(update-in! component ks f & args)
'Updates' a value in the component's local nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created.
'Updates' a value in the component's local nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close