Liking cljdoc? Tell your friends :D

Responses and props

Responses

CallResult
(inertia/render component props)HTML on the first visit, JSON on Inertia visits
(inertia/render component props {:encrypt-history true :clear-history true :preserve-fragment true :ssr false :status 200})Same response, with per-response options
(inertia/location url)Full page load to url: 409 + X-Inertia-Location, or a plain 302 for non-Inertia requests
any Ring redirect302 becomes 303 after PUT/PATCH/DELETE; a #fragment target becomes 409 + X-Inertia-Redirect

Prop types

PropFirst visitPartial reload
plain value or (fn [] ...)sent; fns are calledsent only if requested
(optional f)skippedsent only if requested
(defer f group)skipped, listed in deferredProps; the client fetches each group right after mountsent when requested
(always v)sentalways sent, even if not requested
(merge v), (prepend v), (deep-merge v), with {:match-on "id"}client merges instead of replacingsame, unless listed in X-Inertia-Reset
(once f {:key .. :expires-at ..})skipped while the client holds a copysent when requested
(scroll f {:meta (fn [v] {:current-page .. :next-page ..})})infinite-scroll prop, appends under datasame

These constructors compose, so (merge (defer f)) is valid. defer and optional require a fn. Nested fns inside a prop's value are resolved too. Dot paths such as only: ['auth.user'] resolve only the selected branch.

See the inertia.core API reference for each constructor's options.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close