reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
joshkh 2021-04-18T13:37:09.136800Z

how might i handle the labelComponent property in this example using reagent?

<VictoryBar
  data={sampleData}
  labels={({ datum }) => datum.y}
  style={{ labels: { fill: "white" } }}
  labelComponent={<VictoryLabel dy={30}/>}
/>
i get an error when i do the following, which makes sense, but i'm not sure how to resolve it
[:> VictoryBar {:labelComponent [:> VictoryLabel {:dy 30]}]

react.development.js:221 Warning: Failed prop type: Invalid prop `labelComponent` of type `array` supplied to `VictoryBar`, expected a single ReactElement.

p-himik 2021-04-18T13:40:18.136900Z

It's described literally in the discussion above your post. :)

p-himik 2021-04-18T13:40:44.137100Z

You need as-element or rectify-component.

joshkh 2021-04-18T13:42:25.137300Z

ha, what are the odds. thanks @p-himik

👍 1