helix

defa 2023-09-11T14:00:20.047339Z

Having difficulties to customise @react-navigation/bottom-tabs... how do I translate this snippet of JSX to helix?

<Tab.Screen
  name="Home"
  options={{
    tabBarBadge: 3,
    tabBarIcon: ({color, size}) => (
      <Text>XYZ</Text/>
    ),
  }}>{TabA}</Tab.Screen>
I thought this should translate to:
($ Screen {:name    "Home"
           :options {:tab-bar-badge 3
                     :tab-bar-icon
                     (fn [color size]
                       ($ rn/Text "XYZ"))
                     }}
   TabA)
But the :options key seems to be ignored. I tried with camel-case attributes in options but not difference. Since

defa 2023-09-11T14:06:03.630959Z

Helix version looks like this:

defa 2023-09-11T14:07:12.941809Z

JSX/TSX version:

defa 2023-09-11T14:07:56.746499Z

Jimmy Miller 2023-09-11T17:46:03.808099Z

On phone but you probably want options to be a #js {} instead of a clojure object. With camel-cased keys.

lilactown 2023-09-11T17:50:08.966949Z

jimmy is right

($ Screen {:name    "Home"
           :options #js {:tabBarBadge 3
                         :tabBarIcon
                         (fn [color size]
                           ($ rn/Text "XYZ"))}}
   TabA)

defa 2023-09-12T06:00:52.460739Z

Of course 🙈.... thanks. I looked into the generated JS and it was obvious there, passing ClojureScript data structures to React Native could not work. Interestingly no error messages. Use the source!