GithubHelp home page GithubHelp logo

Comments (2)

Manukyanq avatar Manukyanq commented on June 11, 2024

Hi! I've opened PR with fix. For a temporary solution you can use customPieces prop and for each piece either render <svg> with display:block; style or an <img>

from react-chessboard.

ps2-controller avatar ps2-controller commented on June 11, 2024

Thanks! The workaround gets the job done! I downloaded all the images and used them as follows:

import WP from 'assets/pieces/wP.png'
import WR from 'assets/pieces/wR.png'
etc
              customPieces={{
                wP: () => <img src={WP} alt="White Pawn" style={{display: 'block'}} />,
                wR: () => <img src={WR} alt="White Rook" style={{display: 'block'}} />,
                wN: () => <img src={WN} alt="White Knight" style={{display: 'block'}} />,
                wB: () => <img src={WB} alt="White Bishop" style={{display: 'block'}} />,
                wQ: () => <img src={WQ} alt="White Queen" style={{display: 'block'}} />,
                wK: () => <img src={WK} alt="White King" style={{display: 'block'}} />,
                bP: () => <img src={BP} alt="Black Pawn" style={{display: 'block'}} />,
                bR: () => <img src={BR} alt="Black Rook" style={{display: 'block'}} />,
                bN: () => <img src={BN} alt="Black Knight" style={{display: 'block'}} />,
                bB: () => <img src={BB} alt="Black Bishop" style={{display: 'block'}} />,
                bQ: () => <img src={BQ} alt="Black Queen" style={{display: 'block'}} />,
                bK: () => <img src={BK} alt="Black King" style={{display: 'block'}} />,
              }}

I'll keep an eye out for the merged fix!

from react-chessboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.