When RAD report rendering with multimethods I'm running into a weird case.
(defmethod rr/render-report [:meeting/id :default-mm] [this options]
(let [props (comp/props this)
_ (tap> props)]
(dom/div :.ui.container nil
(rr/render-controls this options)
(rr/render-body this options))))
The first render after I route to the report I get props from the report I am coming from. The odd thing is that the ro/row-pk for that report is :participant/id not :meeting/id. Subsequent renders contain the right props.
Warning: Encountered two children with the same key, [:meeting/id nil]` because there aren't any meetings in the props. I'm sure it is something I am doing wrong but I'll post a pic in reply too just in case anyone else has seen it.The other oddity is I've only ever seen this in Safari (mobile and desktop) so the mystery continues. I'll try running a "release" version from the uberjar now.
as an aside I confirmed that running report/clear-report! on the old report before routing to the new report does prevent the issue, e.g.
(report/clear-report! this ParticipantList)
Getting closer ... I can reproduce it in the fulcro-rad-demo project too (new-rendering branch). If I comment out rro/style in InventoryReport I don't get the blank rows or error you see in the screenshot below. I'll keep digging.
Still working at it but I got it to fail another way ... if I just go back and forth between the Account -> View All and Inventory -> View All reports I can get it to happen too.
Ok will have to test this out later but if seems if I wrap my individual rows like com.fulcrologic.rad.rendering.semantic_ui.report/TableReportLayout does then it works.
So the component hierarchy looks like this:
Instead of this:
I'm still a bit at a loss on root cause ... I suppose it is something I don't understand about react, but I'll let you know if I figure it out.
I guess the thing to remember is that you should always use BodyItem for rendering the rows.
FWIW, I did notice that offending blank rows are rendered somewhere during the uism/load in c.f.r.report/load-report!. As in, the render that causes the blank rows and a render for the right rows happen before the :event/loaded handler fires ... then one more render happens with the right rows.
I guess my laziness led me to just figure that the :keyfn for TableRowLayout in the fulcro-rad-demo was sufficient to prevent this sort of thing - or could be I'm just missing some obvious still.
0:35 and 0:46 of this video show the blank rows. Other than a small datomic deps change it is the stock fulcro-rad-demo new rendering branch. https://youtu.be/SByeZmzpPcc