Public API
Public API
($ tag)
($ tag props & children)
Creates React element
DOM element: ($ :button#id.class {:on-click handle-click} "click me") React component: ($ title-bar {:title "Title"})
Creates React element DOM element: ($ :button#id.class {:on-click handle-click} "click me") React component: ($ title-bar {:title "Title"})
(as-react f)
Interop with React components. Takes UIx component function and returns same component wrapped into interop layer.
Interop with React components. Takes UIx component function and returns same component wrapped into interop layer.
(create-class {:keys [constructor getInitialState render componentDidMount
componentDidUpdate componentDidCatch shouldComponentUpdate
getSnapshotBeforeUpdate componentWillUnmount
childContextTypes contextTypes contextType
getDerivedStateFromProps getDerivedStateFromError
defaultProps displayName]
:as fields})
Creates class based React component
Creates class based React component
(create-context)
(create-context default-value)
Creates React Context with an optional default value
Creates React Context with an optional default value
(create-ref)
Creates React's ref type object.
Creates React's ref type object.
(defui sym & fdecl)
Creates UIx component. Similar to defn, but doesn't support multi arity. A component should have a single argument of props.
Creates UIx component. Similar to defn, but doesn't support multi arity. A component should have a single argument of props.
(glue-args props)
(jsfy-deps coll)
(lazy f)
Like React.lazy, but supposed to be used with UIx components
Like React.lazy, but supposed to be used with UIx components
(memo f)
(memo f should-update?)
Takes component f
and optional comparator function should-update?
that takes previous and next props of the component.
Returns memoized f
.
When should-update?
is not provided uses default comparator
that compares props with clojure.core/=
Takes component `f` and optional comparator function `should-update?` that takes previous and next props of the component. Returns memoized `f`. When `should-update?` is not provided uses default comparator that compares props with clojure.core/=
(parse-sig name fdecl)
(source sym)
Returns source string of UIx component
Returns source string of UIx component
(stringify-clojure-primitives v)
(use-callback f deps)
Takes function f and required vector of dependencies, and returns memoized f.
See: https://reactjs.org/docs/hooks-reference.html#usecallback
Takes function f and required vector of dependencies, and returns memoized f. See: https://reactjs.org/docs/hooks-reference.html#usecallback
(use-context context)
Takes React context and returns its current value
Takes React context and returns its current value
(use-effect f)
(use-effect f deps)
Takes a function to be executed in an effect and optional vector of dependencies.
See: https://reactjs.org/docs/hooks-reference.html#useeffect
Takes a function to be executed in an effect and optional vector of dependencies. See: https://reactjs.org/docs/hooks-reference.html#useeffect
(use-imperative-handle ref f)
(use-imperative-handle ref f deps)
Customizes the instance value that is exposed to parent components when using ref.
See: https://reactjs.org/docs/hooks-reference.html#useimperativehandle
Customizes the instance value that is exposed to parent components when using ref. See: https://reactjs.org/docs/hooks-reference.html#useimperativehandle
(use-layout-effect f)
(use-layout-effect f deps)
Takes a function to be executed in a layout effect and optional vector of dependencies.
See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
Takes a function to be executed in a layout effect and optional vector of dependencies. See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
(use-memo f deps)
Takes function f and required vector of dependencies, and returns memoized result of f.
Takes function f and required vector of dependencies, and returns memoized result of f. See: https://reactjs.org/docs/hooks-reference.html#usememo
(use-reducer f value)
(use-reducer f value init-state)
An alternative to use-state
. Accepts a reducer of type (state, action) => new-state,
and returns the current state paired with a dispatch method.
See: https://reactjs.org/docs/hooks-reference.html#usereducer
An alternative to `use-state`. Accepts a reducer of type (state, action) => new-state, and returns the current state paired with a dispatch method. See: https://reactjs.org/docs/hooks-reference.html#usereducer
(use-ref)
(use-ref value)
Takes optional initial value and returns React's ref hook wrapped in atom-like type.
Takes optional initial value and returns React's ref hook wrapped in atom-like type.
(use-state value)
Takes initial value or a function that computes it and returns a stateful value, and a function to update it.
Takes initial value or a function that computes it and returns a stateful value, and a function to update it. See: https://reactjs.org/docs/hooks-reference.html#usestate
(vector->js-array coll)
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |