Liking cljdoc? Tell your friends :D

helix.core


$clj/s≠

($ type & args)
clj

Create a new React element from a valid React type.

Will try to statically convert props to a JS object.

To pass in dynamic props, use the special & or :& key in the props map to have the map merged in.

Simple example:

($ my-component "child1" ($ "span" {:style {:color "green"}} "child2" ))

Dynamic exmaple:

(let [dynamic-props {:foo "bar"}] ($ my-component {:static "prop" & dynamic-props}))

Create a new React element from a valid React type.

Will try to statically convert props to a JS object.

To pass in dynamic props, use the special `&` or `:&` key in the props map
to have the map merged in.

Simple example:

($ my-component
   "child1"
   ($ "span"
      {:style {:color "green"}}
      "child2" ))

Dynamic exmaple:

(let [dynamic-props {:foo "bar"}]
  ($ my-component
     {:static "prop"
      & dynamic-props}))
cljs

Create a new React element from a valid React type.

Example:

($ MyComponent
 "child1"
 ($ "span"
   {:style {:color "green"}}
   "child2" ))
Create a new React element from a valid React type.

Example:
```
($ MyComponent
 "child1"
 ($ "span"
   {:style {:color "green"}}
   "child2" ))
```
source (clj)source (cljs)raw docstring

$$cljsdeprecated

Dynamically create a new React element from a valid React type.

$ can typically be faster, because it will statically process the arguments at macro-time if possible.

Example:

($$ MyComponent
 "child1"
 ($$ "span"
   {:style {:color "green"}}
   "child2" ))
Dynamically create a new React element from a valid React type.

`$` can typically be faster, because it will statically process the arguments
at macro-time if possible.

Example:
```
($$ MyComponent
 "child1"
 ($$ "span"
   {:style {:color "green"}}
   "child2" ))
```
sourceraw docstring

->methodclj

(->method [sym-name bindings & form])
source

->valueclj

(->value [sym-name value])
source

<>clj/smacro

(<> & children)

Creates a new React Fragment Element

Creates a new React Fragment Element
sourceraw docstring

assoc-somecljs

(assoc-some m k x)
source

cljs-factorycljs

(cljs-factory type)
source

create-componentcljs

(create-component spec statics)
source

create-contextcljs

source

create-elementcljs

source

defcomponentclj/smacro

(defcomponent display-name & spec)

Defines a React class component.

Defines a React class component.
sourceraw docstring

defhookclj/smacro

(defhook sym & body)
source

defncclj/smacro

(defnc display-name & form-body)

Creates a new functional React component. Used like:

(defnc component-name "Optional docstring" [props ?ref] {,,,opts-map} ,,,body)

"component-name" will now be a React function component that returns a React Element.

Your component should adhere to the following:

First parameter is 'props', a map of properties passed to the component.

Second parameter is optional and is used with React.forwardRef.

'opts-map' is optional and can be used to pass some configuration options to the macro. Current options:

  • ':wrap' - ordered sequence of higher-order components to wrap the component in
  • ':helix/features' - a map of feature flags to enable. See "Experimental" docs.

'body' should return a React Element.

Creates a new functional React component. Used like:

(defnc component-name
  "Optional docstring"
  [props ?ref]
  {,,,opts-map}
  ,,,body)

"component-name" will now be a React function component that returns a React
Element.


Your component should adhere to the following:

First parameter is 'props', a map of properties passed to the component.

Second parameter is optional and is used with `React.forwardRef`.

'opts-map' is optional and can be used to pass some configuration options to the
macro. Current options:
 - ':wrap' - ordered sequence of higher-order components to wrap the component in
 - ':helix/features' - a map of feature flags to enable. See "Experimental" docs.

'body' should return a React Element.
sourceraw docstring

extract-cljs-propscljs

(extract-cljs-props o)
source

factorycljs

(factory type)

Creates a factory function for a React component

Creates a factory function for a React component
sourceraw docstring

Fragmentcljs

source

get-reactcljs

(get-react)
source

IExtractTypecljsprotocol

-typecljs

(-type factory)

Extracts the underlying type from the factory function.

Extracts the underlying type from the factory function.
source

memocljs

(memo component)
(memo component compare)

Like React.memo, but passes props as CLJS map-likes instead of JS objects.

Like React.memo, but passes props as CLJS map-likes instead of JS objects.
sourceraw docstring

meta->formclj

source

method?clj

(method? form)
source

providerclj/smacro

(provider {:keys [context value] :as props} & children)

Creates a Provider for a React Context value.

Example:

(def my-context (react/createContext))

(provider {:context my-context :value my-value} child1 child2 ...childN)

Creates a Provider for a React Context value.

Example:

  (def my-context (react/createContext))

  (provider {:context my-context :value my-value} child1 child2 ...childN)
sourceraw docstring

register!cljs

(register! type id)

Registers a component with the React Fresh runtime. type is the component function, and id is the unique ID assigned to it (e.g. component name) for cache invalidation.

Registers a component with the React Fresh runtime.
`type` is the component function, and `id` is the unique ID assigned to it
(e.g. component name) for cache invalidation.
sourceraw docstring

signature!cljs

(signature!)
source

static?clj

(static? form)
source

suspenseclj/smacro

(suspense {:keys [fallback]} & children)

Creates a React Suspense boundary.

Creates a React Suspense boundary.
sourceraw docstring

Suspensecljs

source

typecljs

(type f)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close