Like Paul is saying, if you’re putting the CustomDot in brackets as you are passing it into Carousel, you are doing the rendering of that component into React.element. You don’t pass the props to CustomDot there in your example so its unclear which way you want that to go.
If its the Carousel that applies onMove, index etc to CustomDot, you would say like…
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
at createFiberFromTypeAndProps (react-dom.development.js:28435:17)
at createFiberFromElement (react-dom.development.js:28461:15)
at createChild (react-dom.development.js:15110:28)
at reconcileChildrenArray (react-dom.development.js:15405:25)
at reconcileChildFibers (react-dom.development.js:15822:16)
at reconcileChildren (react-dom.development.js:19163:28)
at updateHostComponent (react-dom.development.js:19920:3)
at beginWork (react-dom.development.js:21614:14)
at HTMLUnknownElement.callCallback (react-dom.development.js:4165:14)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4214:16)
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?