Closed
Description
type props = {count: int}
let someBoolean = v => Js.Math.random_int(1, v) % 2 == 0
@react.componentWithProps
let make =
@directive("'use memo'")
props => {
if someBoolean(5) {
React.useState(_ => 5)->ignore
}
Array.fromInitializer(~length=props.count, idx => idx)
->Array.map(_ =>
<span className="text-2xl text-yellow-500 icon-[mdi-light--star]" />
)
->React.array
}
no longer transforms the function name of make
.