Skip to content

Commit 1757301

Browse files
authored
SortableList and SortableGridList - improve data docs (#2357)
1 parent 7a14bcf commit 1757301

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/sortableGridList/sortableGridList.api.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
"extends": ["lists/GridList"],
77
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/SortableGridListScreen.tsx",
88
"props": [
9-
{"name": "data", "type": "any[] & {id: string}", "description": "Data of items with an id prop as unique identifier"},
9+
{
10+
"name": "data",
11+
"type": "any[] & {id: string}",
12+
"note": "Do not update 'data' in 'onOrderChange' (i.e. for each order change); only update it when you change the items (i.g. adding and removing an item).",
13+
"description": "Data of items with an id prop as unique identifier"
14+
},
1015
{"name": "renderItem", "type": "FlatListProps['renderItem']", "description": "Custom render item callback"},
1116
{
1217
"name": "onOrderChange",

src/components/sortableList/SortableList.api.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"name": "data",
1111
"type": "ItemT[] (ItemT extends {id: string})",
1212
"description": "The data of the list, with an id prop as unique identifier.",
13+
"note": "Do not update 'data' in 'onOrderChange' (i.e. for each order change); only update it when you change the items (i.g. adding and removing an item).",
1314
"required": true
1415
},
1516
{

0 commit comments

Comments
 (0)