Fork me on GitHub
#cljsrn
<
2021-02-19
>
George Ciobanu06:02:33

Apologies for the potentially super noob question. I'm using Krell (https://github.com/vouch-opensource/krell) to develop a mobile app and want to add more react native components such as Switch and Navigator. But the file https://github.com/vouch-opensource/reagent-react-native/blob/master/src/reagent/react_native.cljs does not include switch and many other react native components. I tried adding it by hand but it doesn't work. Am I missing anything super obvious? Any help would be much appreicated

Michaël Salihi10:02:39

@geo.ciobanu You can require (:require [react-native :as rn] in your namespace, then call Switch like that [:> rn/Switch {:value ,,,}] . Make sense? [:> ,,,] is a macro shortcut for reagent/adapt-react-class : https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md#creating-reagent-components-from-react-components

George Ciobanu17:02:16

Thank you so so much Michael!