author of the library here, in your examples you look to be using the v4 API, v5 has a completely new API where config is passed in via the options
prop. I recommend reading the docs: https://react-chessboard.vercel.app/?path=/docs/how-to-use-options-api--docs#optionsonpiececlick
// handle piece click
const onPieceClick = ({
square,
piece,
isSparePiece
}: PieceHandlerArgs) => {
console.log(piece.pieceType);
};
// chessboard options
const chessboardOptions = {
allowDragging: false,
onPieceClick,
id: 'on-piece-click'
};
// render
return <Chessboard options={chessboardOptions} />;