Thanks to visit codestin.com
Credit goes to github.com

Skip to content

@react.componentWithProps no longer works with @directive("'use memo'") #7293

@nojaf

Description

@nojaf

Playground

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions