What worked for me is
let defaultDotProps = {
onMove: _ => (),
index: 0,
carouselState: defaultStateCallBack,
onClick: _ => (),
active: false,
}
module CustomDots = {
type props<'dotsProps> = {dotsProps: 'dotsProps}
let make = props => {...}
}
<ReactMultiCarousel customDot={CustomDots.make} >children </ReactMultiCarousel>
in ReactMultiCarousel component
let customDot = customDot->Belt.Option.map(customDot => %raw(`JsxRuntime.jsx(customDot, {})`))
<>
making ~customDot: Jsx.element=?,
so I think what was happening was when passing element it was appling property to dom which will be div so instead of passing element we can passing jsx component and inside library we are already calling cloneElement to pass the required element so this worked
but I’m not sure about the correctness of this solution even though it worked
@tsnobip @mouton is there any better way for doing this?