Skip to content

FEN display issue #9

@mlava

Description

@mlava

Hi there.
Great extension, thanks for it.
I am trying to implement such that when the board is rendered it is rendered at the point of time suggested by the FEN. The code below isn't working. I just get a board at starting positions...
fenString is the FEN obtained from API.
Any ideas?

const boardConfig = { fen: fenString };
return (
    <ChessPGNAnalysisBoard
        config={boardConfig}
        pgnString={pgn}
    />
)

If I console.log(boardConfig) I get what looks to be correct:

{ "fen": "rnbqk2r/pppp1ppp/4p3/4P3/3P2Q1/2b5/P1PB1PPP/R3KBNR b KQkq - 1 7" }

If I define as shown const config = {boardConfig}; and console.log I get:

{
    "boardConfig": {
        "fen": "rnbqk2r/pppp1ppp/4p3/4P3/3P2Q1/2b5/P1PB1PPP/R3KBNR b KQkq - 1 7",
        "ChessBoardProps": {}
    }
}

Changing the render return to below doesn't work:

<ChessPGNAnalysisBoard
  config={config}
  pgnString={pgn}
/>

I'm just not sure what I'm doing wrong. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions