Allow disable the profiler.

This commit is contained in:
Andrey Antukh 2020-04-10 14:31:53 +02:00 committed by Alonso Torres
parent 340faa3a27
commit c85fd20a58

View file

@ -57,9 +57,12 @@
[props]
(let [children (unchecked-get props "children")
label (unchecked-get props "label")
enabled? (unchecked-get props "enabled")
on-render (mf/use-memo
(mf/deps label)
#(on-render-factory label))]
(if enabled?
[:> react/Profiler {:id label
:on-render on-render}
children]))
children]
children)))