I'm having trouble with js interop. I'm trying to use a js component react-slick like this:
// src/interop/Carousel.js
import React from 'react'
import Slider from 'react-slick'
export function Carousel(props) {
return (
<Slider>
<div>
<h3>{props.name} 1</h3>
</div>
</Slider>
)
}
/* src/Carousel.re */
[@bs.module "./interop/Carousel"] [@react.component]
external make: (~name: string) => React.element = "";
/* src/index.re */
ReactDOMRe.renderToElementWithId(<Carousel name="ahaha" />, "carousel");
But met with this error in webpack:
ERROR in ./lib/js/src/Index.bs.js
Module not found: Error: Can't resolve './interop/Carousel' in '[...]/reason_react_example/lib/js/src'
@ ./lib/js/src/Index.bs.js 6:15-44
So it looks like BS doesn't consider Carousel.js
file when compile?
btw, I'm following this reason-react doc