Fork me on GitHub
Lyn Headley01:05:21

Interesting react useWebsocket hook -- could be an alternative to something like sente if your app is structured around hooks already.

Lyn Headley12:05:03

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

Roman Liutikov15:05:21

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

ūüĎć 4

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

  (: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';
What’s the Rum equivalent?

Lyn Headley17:05:11

@amalantony untested, but I would think:

Lyn Headley17:05:12

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


@laheadle That works, thank you!


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