A minimalistic ClojureScript interface to React.js
yenda 2020-10-21T14:52:45.075500Z

In react-native there is a new Pressable component that can take a function as a child:

        onPress={() => {
          setTimesPressed((current) => current + 1);
        style={({ pressed }) => [
            backgroundColor: pressed
              ? 'rgb(210, 230, 255)'
              : 'white'
        {({ pressed }) => (
          <Text style={styles.text}>
            {pressed ? 'Pressed!' : 'Press Me'}
      <View style={styles.logBox}>
        <Text testID="pressable_press_console">{textLog}</Text>
When I try passing a clojurescript fn:
[react/pressable {:on-press on-submit}
             (fn [^js props]
               (let [pressed (when props
                               (.-pressed props))]
                 (println pressed)
                 [next-button pressed]))]
I get functions are not valid as a React child Is there a way to use this component in cljs?

ferossgp 2020-10-21T15:10:16.076800Z

The error appears because you need to return a react element from that function (reagent/as-element [next-button pressed]) instead of [next-button pressed] same as with render props


Hi folks, Could you recommend a react data grid that you've successfully integrated with cljs ?


@geraldodev I already used this library and it works very well :