In the Slider example of Material UI (link to codesandbox: https://codesandbox.io/s/hzhqj?file=/demo.tsx), there is an option to pass custom components if you want to use a different subcomponent for a maincomponent.
<Slider
valueLabelDisplay="auto"
components={{
ValueLabel: ValueLabelComponent,
}}
aria-label="custom thumb label"
defaultValue={20}
/>
By default, Material UI passes 'props' to ValueLabelComponent, so essentially this:
ValueLabel: (props) => ValueLabelComponent(props)
I would like to pass additional data, a simple variable, to this. The custom component can already take a second parameter (ValueLabelComponent(props, additionalData))
How to pass additional parameters to the custom component in this structure?
(Note: I tried this, but it won't work of course: ValueLabel: (props, additionalData) => ValueLabelComponent(props, additionalData))