Javascript React native flatlist正在isLoading上的组件之间共享道具

Javascript React native flatlist正在isLoading上的组件之间共享道具,javascript,arrays,typescript,react-native,react-native-flatlist,Javascript,Arrays,Typescript,React Native,React Native Flatlist,我目前正在使用flatlist制作react native中的项目列表,我面临的问题是它在列表中所有项目实例之间共享我的isloading道具。这意味着,如果我点击一个项目,所有项目,然后显示它正在加载。我已经尝试了额外的数据和独特的钥匙,但我真的不知道该怎么做 接口IBugListProps{ 已选中:(bugListItem:BugModel)=>void; onDeletePress:(bugListItem:BugModel,索引:number)=>void; 刷新:布尔; onRef

我目前正在使用flatlist制作react native中的项目列表,我面临的问题是它在列表中所有项目实例之间共享我的isloading道具。这意味着,如果我点击一个项目,所有项目,然后显示它正在加载。我已经尝试了额外的数据和独特的钥匙,但我真的不知道该怎么做

接口IBugListProps{
已选中:(bugListItem:BugModel)=>void;
onDeletePress:(bugListItem:BugModel,索引:number)=>void;
刷新:布尔;
onRefresh:()=>任何;
bugListItems:BugModel[];
isLoading:布尔值;
}
常量错误列表=(道具:IBugListProps)=>{
返回(
(listItem.id作为编号).toString()}
renderItem={({项,索引,分隔符})=>(
props.onDeletePress(项目,索引)}
isLoading={props.isLoading}
>
道具。已选定(_项)}
/>
)}
/>
);
}

导出默认错误列表调用props.onItemSelected(_item)时,将发送的项目保存在状态(例如selectedItem)中,并将isLoading传递给SwipableItem,而不是

<SwipableItem ... isLoading={props.isLoading} /> 

你可以

<SwipableItem ... isLoading={item.id === props.selectedItem.id ? props.isLoading : false} />