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
@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
Thank you so so much Michael!
You're welcome!