☝️ This is now on NPM, so you can use --template react-native-template-cljs-krell-storybook
I put together a template for RN with a working CLJS, Krell, and Storybook environment, including requiring local JS components: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook
It’s a one-liner to get it all installed: npx react-native init YourProjectName --template
I still need to touch up the README, but anyone who’s been working on this who wants to poke around before I publicize it, please feel free
Very excited about this! I may deprecate my own cljsrn repo and migrate to using this template for my production work. Out of curiosity, how hard do you figure it would be to integrate the template with Expo? I’m not sure if it’s worth the time investment to try and get Expo’s tooling before I actually have to start writing an actual app 😅
been looking with great interest at this approach @joshmiller... but how do people generally manage datastructures across the cljs/js divide - e.g. looking at the http://vouch.io vids, cljs datastructures are passed directly to UI components like ui/dashboard - but those components are vanilla js components developed with storybook - so how are they working with the cljs datastructures ?
@mccraigmccraig I’m not sure in the Vouch videos exactly how they’re doing it, but the way I handle it is to use reagent.adapt-react-class (which will automatically convert a map of args to JS props) and if necessary a thin wrapper.
So if you have a JS User component that takes props like { firstName:, email: }:
(def user (r/adapt-react-class User))
...
[user {:first-name "Name" :email ""}] If I need to do more processing than that, I would make a thin Clojure component that just handles the data conversion then passes the bare data along.
ah, ok - i've not used adapt-react-class before... that looks like it does a deep conversion, so should also work fine with component nesting
I've never actually tried Expo, so I'm not sure. I don't think there's any particular conflicts, except for possibly Expo having its own template.