Giter Site home page Giter Site logo

Comments (2)

qiufeihong2018 avatar qiufeihong2018 commented on June 3, 2024

Describe the bug A clear and concise description of what the bug is. When following the docs https://reactgrid.com/docs/4.0/2-implementing-core-features/1-handling-changes/, I am getting the type error when assigning handleChanges to onChange

No overload matches this call.
  Overload 1 of 2, '(props: ReactGridProps | Readonly<ReactGridProps>): ReactGrid', gave the following error.
    Type '(changes: CellChange<TextCell>[]) => void' is not assignable to type '(cellChanges: ({ readonly rowId: Id; readonly columnId: Id; readonly type: "checkbox"; readonly previousCell: CheckboxCell & Cell; readonly newCell: CheckboxCell & Cell; } | ... 7 more ... | { ...; })[]) => void'.
      Types of parameters 'changes' and 'cellChanges' are incompatible.
        Type '({ readonly rowId: Id; readonly columnId: Id; readonly type: "checkbox"; readonly previousCell: CheckboxCell & Cell; readonly newCell: CheckboxCell & Cell; } | ... 7 more ... | { ...; })[]' is not assignable to type '{ readonly rowId: Id; readonly columnId: Id; readonly type: "text"; readonly previousCell: TextCell; readonly newCell: TextCell; }[]'.
          Type '{ readonly rowId: Id; 

Current behavior A clear and concise description of what you current see. Type Error

Expected behavior A clear and concise description of what you expected to happen. No type error

Screenshots or gifs If applicable, add screenshots to help explain your problem.

Screenshot 2024-01-04 at 11 55 02 PM **Your environment details**

Chrome desktop

An error might mean something like this: your function only handles TextCell type changes, but your component needs a function that handles changes including CheckboxCell and many other types.

from reactgrid.

DLowHP avatar DLowHP commented on June 3, 2024

This is related to #128. I posted a solution for this in the mentioned issue's comment.

from reactgrid.

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.