Utilities for converting ClojureScript prop maps into JavaScript objects suitable for passing to react-map-gl components.
Convention:
Utilities for converting ClojureScript prop maps into JavaScript objects suitable for passing to react-map-gl components. Convention: - Incoming: CLJS map with kebab-case keyword keys (or string keys for pass-through) - Outgoing: JS object with camelCase string keys - Callback values (fns) are passed through unchanged - Nested CLJS maps on JS/CSS props (:initial-view-state, :style, :padding, :bounds, :fit-bounds-options) are converted recursively with camelCase keys. - Nested CLJS maps on MapLibre style spec props (:paint, :layout, :filter) are converted recursively with kebab-case keys (e.g. :circle-radius → "circle-radius"). - All other values are passed through as-is (numbers, strings, booleans)
(props->js props)Convert a ClojureScript props map to a JS object for react-map-gl.
Convert a ClojureScript props map to a JS object for react-map-gl. - Keyword keys are converted from kebab-case to camelCase - String keys are used as-is (no conversion) - Values for known nested-data keys (:initial-view-state, :style, etc.) are converted with clj->js - All other values (including callback fns) pass through unchanged
(props-and-children args)Split Reagent component args into [props children]. If the first arg is nil or a map, it is the props; otherwise props is {}.
Split Reagent component args into [props children].
If the first arg is nil or a map, it is the props; otherwise props is {}.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 |