Cljs reagent components not refreshing/redrawing in devcards

Hi everyone,

I recently started a new cljs project and decided to take the time to learn and use devcards since I’ve heard so many good things about it.

The problem that made me create this post is this:

I have a component that works correctly in the “main” app but does not work in a devcard. I believe it’s a fairly simple component; it takes a ratom (a list of items), displays the contents and adds items to the list. I have two shadow-cljs builds, one for devcards and one for the “main” app. In the main app the components works as expected, the UI is redrawn when new items are added to it.

In the devcard this does not happen. I’ve enabled the :inspect-data option, which displays the state in the ratom. When items are added to the state, the update is reflected in the displayed state, but the actual UI of the component does not redraw. When I browse away to the devcards main UI and back to this card, the UI is drawn with the updates.

Here’s my questions:

  • I don’t have first-class javascript-based react knowledge, my experience with react is exclusively based on reagent. Could this bug in devcards be related to what I’m experiencing? Warning: componentWillMount has been renamed · Issue #163 · bhauman/devcards · GitHub I’m getting the same warning in my browser console.
  • If the previous item is indeed the issue, would it be a good strategy to revert to an older version of react? The output of shadow-cljs picks up that I have a newer version of react than the one that devcards depend on:
NPM dependency "react" has installed version "^17.0.2"
"16.13.1" was required by jar:file:/home/pieter/.m2/repository/devcards/devcards/0.2.7/devcards-0.2.7.jar!/deps.cljs
  • Is devcards still being maintained? I see a few open issues that look like they have not been acknowledged by Mr Hauman.
  • To the people who are using or have used devcards in their apps; Any other advice or tips for me?
  • Are there other tools in this space? I know about Storybook, and initially decided against it in favor of devcards. Would you recommend I revisit this decision?