Closed
Description
After upgrading to 7.25.0 I get a false positive from react/function-component-definition
on the anonymous arrow function returned inside this:
function mapStateToProps() {
const internItems = makeInternArray<DimItem>();
const internClassList = makeInternArray<DestinyClass>();
return (
state: RootState,
props: ProvidedProps
): StoreProps & {
store: DimStore | null;
} => {
const { store, bucket, singleCharacter } = props;
let items = findItemsByBucket(store, bucket.hash);
if (singleCharacter && store.isVault && bucket.vaultBucket) {
for (const otherStore of storesSelector(state)) {
if (!otherStore.current && !otherStore.isVault) {
items = [...items, ...findItemsByBucket(otherStore, bucket.hash)];
}
}
const currentStore = currentStoreSelector(state)!;
items = items.filter(
(i) => i.classType === DestinyClass.Unknown || i.classType === currentStore.classType
);
}
return {
store: null,
destinyVersion: store.destinyVersion,
storeId: store.id,
storeName: store.name,
storeClassType: store.classType,
isVault: store.isVault,
items: internItems(items),
itemSortOrder: itemSortOrderSelector(state),
// We only need this property when this is a vault armor bucket
storeClassList:
store.isVault && bucket.inArmor
? internClassList(sortedStoresSelector(state).map((s) => s.classType))
: emptyArray(),
characterOrder: characterOrderSelector(state),
isPhonePortrait: isPhonePortraitSelector(state),
};
};
}
Since this is returning an object and not JSX, I don't think it should be detected as a React component.