willb335 / chessboardjsx

:black_square_button: Chessboard built for React
https://chessboardjsx.com
MIT License
267 stars 79 forks source link

fix(chessboard): update types #43

Closed myarete closed 5 years ago

myarete commented 5 years ago

I'm not sure if there's any particular reason that the type string was being used over Square || Piece, but it causes clashing with the types from chess.js. I personally feel that the types from chess.js should be used as much as possible since people will be using these libs together. Especially given that the type Square in both typedefs is identical.

Their type for Piece is slightly different, but for my use case, changing to Square instead of string fixes my issues with the callbacks such as onDrop :)

Before: Before the fix

After: After the fix

codecov-io commented 5 years ago

Codecov Report

Merging #43 into master will not change coverage. The diff coverage is n/a.

@@          Coverage Diff           @@
##           master     #43   +/-   ##
======================================
  Coverage    62.4%   62.4%           
======================================
  Files          10      10           
  Lines         274     274           
  Branches       63      63           
======================================
  Hits          171     171           
  Misses         81      81           
  Partials       22      22
slig commented 5 years ago

I added the types originally and I'm not sure why I didn't do what you're suggesting either. +1.

willb335 commented 5 years ago

:tada: This PR is included in version 2.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

myarete commented 5 years ago

Woop woop!