Liking cljdoc? Tell your friends :D

helix.core


$clj/smacro

($ type & args)

Create a new React element from a valid React type.

Will try to statically convert props to a JS object. Falls back to $$ when ambiguous.

Example:

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

Will try to statically convert props to a JS object. Falls back to `$$` when
ambiguous.

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

$$cljs

($$ type & args)

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

create-componentcljs

(create-component spec statics)
source

create-elementcljs

source

defcomponentclj/smacro

(defcomponent display-name & spec)

Defines a React class component.

Defines a React class component.
sourceraw docstring

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

'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

'body' should return a React Element.
sourceraw docstring

factorycljs

(factory type)

Creates a factory function for a React component

Creates a factory function for a React component
sourceraw docstring

Fragmentcljs

source

IExtractTypecljsprotocol

-typecljs

(-type factory)

Extracts the underlying type from the factory function.

Extracts the underlying type from the factory function.
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