rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
2020-05-02T01:05:21.070900Z

Interesting react useWebsocket hook -- could be an alternative to something like sente if your app is structured around hooks already. https://www.npmjs.com/package/react-use-websocket

2020-05-02T12:30:03.071800Z

When I am passing a deps vector to use-effect, do I need to (cljs->js my-vector) ?

2020-05-02T15:26:21.074Z

No, if deps is not an array Rum transforms it into array with into-array. Might be a good idea to add this into docstring for hooks

👍 1
amalantony 2020-05-02T16:43:53.078100Z

How can I use an external imported React component in Rum? This is my ns code:

(ns <http://acme.frontend.app|acme.frontend.app>
  (:require [rum.core :as rum]
            [goog.dom :as dom]
            ["react-moment" :default Moment]))
And this is how I’m trying to render it:
(rum/defc time-component []
  [Moment "1976-04-19T12:59-0500"])
This does not work as expected. This is how the component would look in JSX:
import Moment from 'react-moment';
export default class MyComponent extends React.Component {
    render() {
        return (
            const dateToFormat = '1976-04-19T12:59-0500';
            &lt;Moment&gt;{dateToFormat}&lt;/Moment&gt;
        );
    }
}
What’s the Rum equivalent?

2020-05-02T17:31:11.078900Z

@amalantony untested, but I would think:

2020-05-02T17:31:12.079100Z

(rum/defc time-component [] [:div (rum/adapt-class Moment {} "1976-04-19T12:59-0500"]])

amalantony 2020-05-02T17:46:08.079900Z

@laheadle That works, thank you!

amalantony 2020-05-02T17:50:43.080800Z

Will adapt-class work for isomorphic server side rendering as well?