(Victory) Trouble adding styles to custom bar components

90 Views Asked by At

I'm attempting to implement a custom bar component in a chart I'm building... but styles aren't being applied.
Here's a sandbox:
https://codesandbox.io/s/custom-bar-9cfl2?file=/src/App.js.
Goal is for the chart to have blue bars, but have the 3rd bar be red. Any feedback is much appreciated!

1

There are 1 best solutions below

0
On

Figured this out. Needed to spread the rest of the style props in.

{ ...style, fill: index === 2 ? "red" : "blue" }