react-native-tableview-list icon indicating copy to clipboard operation
react-native-tableview-list copied to clipboard

Handle configuring `menu`, `onDeleteRow` per row

Open jacobp100 opened this issue 1 year ago • 0 comments

One idea is for each property to be able to be set/unset on the component at the top level, in the section, and/or in the row. I.e.

<TableView
  onDeleteRow={fn1}
  sections={[
    {
      ...section,
      onDeleteRow: fn2,
      data: [
        {
          onDeleteRow: fn3,
          value: "something",
        },
      ],
    },
  ]}
/>

So fn3 overrides fn2 overrides fn1 - and if fn3 was undefined, it would unset it (so the row isn't deletable)

This needs to be done for

  • onDeleteRow
  • menu

This needs the type section.data to be refactored to allow these props

The advantage of this - rather than having things like the menu prop being a function - is that we can minimise the data sent over the bridge.

jacobp100 avatar Oct 20 '22 10:10 jacobp100