CompositionalIT / feliz-ag-grid

9 stars 4 forks source link

Custom props cannot be used as AgGrid props #27

Closed martinbryant closed 4 months ago

martinbryant commented 4 months ago
AgGrid.grid [
    AgGrid.rowClassName "hover:cursor-pointer"
    AgGrid.suppressRowHoverHighlight
// removed for brevity
]

Expected

AgGrid.suppressRowHoverHighlight can be used as a prop here

Actual

The type IReactProperty is not compatible with the type IAgGridProp<'row>

Workaround

I have defined an extension to give add this behaviour in my project, unfortunately it cannot be overridden

static member inline suppressRowHoverHighlighting (v: bool) = 
    agGridProp<'row>("suppressRowHoverHighlight" ==> v)
mattgallagher92 commented 4 months ago

🫤 My best guess is that AgGrid properties added in #10 weren't tested by the author :facepalm:

The "good" news is that none of the props using prop.custom will work in the argument list to AgGrid.grid, so we can probably change them to IAgGridProps without considering it a breaking change (even though it technically is) - it's unlikely any package users are using those props. Hence we can consider the fix a patch rather than a new major version.