Closed lyuben-todorov closed 4 years ago
Then I saw that the npm package hasn't been updated for 2 years?
We will fix that.
Have you installed and applied style-loader
in webpack?
Hi, friend, we have fixed that issue due to changes of css classnames made by chessground
. Pls upgrade react-chessground
to version 1.1.0
. BTW, we have also upgraded all dependency modules to latest versions.
Thanks for the update! Styles seem to be doing fine, however the board is still broken. This is what I'm getting from the example after I updated it's dependencies: I'm also getting the same situation from a CRA project:
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Chessground from 'react-chessground';
import 'react-chessground/dist/styles/chessground.css'
function App() {
return (
<div className="App">
<Chessground
width="38vw"
height="38vw"
orientation={'w'}
turnColor={'w'}
viewOnly={false}
fen={"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}
style={{ margin: "auto" }}
/> </div>
);
}
export default App;
You haven't included theme.css: `import 'react-chessground/dist/assets/theme.css'
I'm still getting the same bug. When I originally encountered this I saw the 'import a theme or board won't work' warning in chessground.css so I copied chessground-theme.css from /assets and imported it as such:
import 'react-chessground/dist/styles/chessground-theme.css'
Still, theme is here but positions are messed up
Have you upgraded to Version 1.1.0
Hey, friend, I've just created a demo repo here using create-create-app
https://github.com/ruilisi/react-chessground-demo.
Hope this could help you!
The demo works. Thanks! I've found the culprit. The bug is symptomatic to removing
import "react-chessground/dist/assets/chessground.css";
So far I was importing from "react-chessground/dist/styles/chessground.css";
instead, which was the path instructed in the readme, so that probably needs to be updated too. Thanks for the help!
Thanks for noticing that, that was fixed.
had same problem with all pieces on a8 square, and only helps these imports:
import "react-chessground/dist/assets/chessground.css"
import "react-chessground/dist/styles/chessground.css"
Have you imported /dist/assets/theme.css
?
previously - not, but now makes test with this import and it only changed squares on blue color, trying different combinations and works only mentioned in previous comment
Using a default, unejected, CRA project, I'm unable to get this to render. To reproduce simply get a CRA project and copy/paste the code under installation. My App.js:
my index.js:
This is how the page looks like: