Fork me on GitHub
#portal
<
2024-06-16
>
Jakub08:06:43

I am creating custom viewers by wrapping the inspector component. It seems that customizing works both by passing props and metadata. Is there a difference between these two and considerations which one to prefer?

;; Using metadata
[ins/inspector
 {}
 (with-meta value {::pv/default ::pv/table})]

;; Using props
[ins/inspector
 {::pv/default ::pv/table}
 (with-meta value {})]

djblue05:07:19

Sorry it's taken a bit to respond, but I would say the metadata way would be the more "officially" supported method but either works. Did you end up choosing a strategy?

djblue05:07:05

I think the biggest constraint is if the value you intend to pass to this viewer supports metadata 👌

Jakub11:07:51

yeah, in my case I pass values that support metadata, so the metadata approach will likely be more predictable 👍

👍 1