I have this simple Higher-Order Component that works fine but it only accepts a single component:
let VerticalSlider = (Komponent) => {
return (props) => (
<div className='slider'>
<Komponent {...props}/>
</div>
);
};
How would one rewrite the HOC to accept multiple components (unknown number) and return them as siblings (one by one under eachother) together with their respective props?
I assume this is how you'd call a HOC with multiple components as it's just a function:
VerticalSlider(MyComponent, MyOtherComponent)
I know how to accept and destruct an unknown number of "normal" props, but I'm a but lost here when it comes to passed in components.