Skip to content

We don't support functions on client components #230

Open
@pedrobslisboa

Description

@pedrobslisboa

Description

It's not possible to have function on client components as the sample bellow:

// Foo.re
[@react.client.component]
let make = (~onClickFoo: unit => unit) => {
  <button onClick={_ => {
    onClickFoo()
  }}/>
}

// Client_component.re
[@react.client.component]
let make = () => {
  let onClickFoo = () => Js.log("Hello from client");
   
  <Foo onClickFoo={onClickFoo}/>
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions