glideapps / glide-data-grid

🚀 Glide Data Grid is a no compromise, outrageously react fast data grid with rich rendering, first class accessibility, and full TypeScript support.
https://grid.glideapps.com
MIT License
4.07k stars 301 forks source link

useCustomCells removed in v6? #888

Open UberMouse opened 9 months ago

UberMouse commented 9 months ago

Upon attempting to upgrade to v6 I've noticed that useCustomCells is no longer exported from @glideapps/glide-data-grid. I don't see any mention of this removal anywhere, or any indication what to use instead

lukasmasuch commented 9 months ago

This change with v6: You can just provide a list of custom cells to use in the customRenderers props. Or you can import all via:

import { allCells } from "@glideapps/glide-data-grid-cells"

 <DataEditor
      # ... other props,
      customRenderers={allCells}
 />
UberMouse commented 9 months ago

So instead of doing

    const customCellsArgs = useCustomCells([ButtonCell, RangeCell]);

     <DataEditor
       ref={gridRef}
       {...customCellsArgs}
      />

You now just do

     <DataEditor
       ref={gridRef}
       customRenderers={[ButtonCell, RangeCell]}
      />
lukasmasuch commented 9 months ago

Yep, I believe that should work. Also, see the comment here on how you can use a custom drawing.

UberMouse commented 9 months ago

Ok thanks :) I'll give the upgrade another go when I get a chance. v6 looks nice :)