Fork me on GitHub
#reagent
<
2021-04-18
>
joshkh13:04:09

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-himik13:04:18

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

p-himik13:04:44

You need as-element or rectify-component.

joshkh13:04:25

ha, what are the odds. thanks @U2FRKM4TW

👍 3