victory v35.9.0 Release Notes
Release Date: 2021-06-24 // almost 3 years ago-
โ Adds a new
disableInlineStyles
prop to components and primitives to support users who want to style their components by class, or use a CSS in JS solution likestyled-components
๐ When the new
disableInlineStyles
prop is supplied to a component likeVictoryBar
no styles will be supplied to either data or label components that it renders:const StyledBar = styled(Bar)` fill: purple; `; const StyledLabel = styled(VictoryLabel)` tspan { fill: magenta; font-family: Papyrus, fantasy; } `; function CustomStyledBarChart() { return ( <VictoryChart> <VictoryBar disableInlineStyles labels={[1, 2, 3, 4]} dataComponent={<StyledBar />} labelComponent={<StyledLabel />} /> </VictoryChart> ); }
๐ The
disableInlineStyles
prop may also be supplied to primitive components for more granular control:const StyledBar = styled(Bar)` fill: purple; `; function CustomStyledBarChart() { return ( <VictoryChart> <VictoryBar labels={[1, 2, 3, 4]} dataComponent={<StyledBar disableInlineStyles />} /> </VictoryChart> ); }
Related PRs