Fork me on GitHub
#fulcro
<
2022-01-13
>
sheluchin16:01:48

Is there anywhere I can see an example of a RAD report for an individual item rather than a list of items? It sounds like appropriate use of reports given the general description (params, query, UI), but the semantics of the report-options and all the examples are geared towards lists of things. Is a case where it's better to drop down to just a simple defsc instead of defsc-report, or is there a way to use RAD reports for individual items?

tony.kay17:01:53

I’d recommend using a plain defsc for a single item, or a read-only form.

tony.kay17:01:44

My reasoning was that a read-only form is a view of a single item, and you need an ID a the list of things you want to see, and you want to lay them out.

tony.kay17:01:08

you can create custom resolvers to create virtual attributes, which can be displayed in such a form

sheluchin17:01:18

You suggest leaning towards a RO form over a plain defsc? I guess using a RAD form just helps stick to the RAD approach over dropping down to Fulcro?

sheluchin17:01:30

> As you can see there is some overlap in forms and reports. A read-only form is very much like a report, and a report with sufficient "row actions" (i.e. each cell can be clicked to edit) can behave very much like a form. Makes sense then. I've been avoiding RAD forms because I'm not intending to collect any input, but I know there have been many form improvements made recently, so why not. Thanks @tony.kay.

tony.kay17:01:37

The only downside of using a RO form is that I have not, myself, needed to do that, so some of the SUI plugin controls might have bugs or not look great. PRs welcome.

👍 1
hadils18:01:48

Hi! I am using HOC and I am getting an error “React is not defined”. This occurred after I started using HOC components. Any suggestions?

tony.kay19:01:37

that isn’t defined when using shadow, you have to require it ["react" :as react] then use react/whatever

tony.kay19:01:57

I used to use cljsjs react, which just brought in the global. I don’t do that anymore.

hadils19:01:37

The interop/hoc-factory calls js/React. How do I work around that?

tony.kay19:01:21

send a MR 😊

tony.kay19:01:28

or give me a few mins to fix it?

tony.kay19:01:34

Try 3.5.11-SNAPSHOT

tony.kay19:01:44

if that fixes it I’ll push a formal release

hadils19:01:30

Thanks @tony.kay. I copied the library and made the change. I will test yours when I’ve debugged my next problem:confused:👍

hadils15:01:54

Hi @tony.kay. It works! Thank you very much for your effort.