Skip to content

Question on registering move in logic #102

@medavas

Description

@medavas

Hello, I was wondering if someone can speak to onMove in this snippet is being invoked instead of called with parenthesis. I wrote my own validation for this and not understanding how the move that is played on chessground gets passed into the validator such as () => onMove(from, to, promoteTo), I see this example is using chess.js. Let me know if I can clarify anything. Thanks for your time.

Ryan

<Chessground
  width="38vw"
  height="38vw"
  turnColor={turnColor()}
  movable={calcMovable()}
  lastMove={lastMove}
  fen={fen}
  onMove={onMove}
  style={{ margin: "auto" }}
/>

Metadata

Metadata

Assignees

No one assigned

    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