Clean some code
This commit is contained in:
parent
5f087a2def
commit
15a749ef70
2 changed files with 6 additions and 6 deletions
|
@ -172,7 +172,7 @@ const Item = ({
|
|||
loaded={loaded}
|
||||
id={id}
|
||||
>
|
||||
<Component {...rest} x={0} y={0} setState={updateState} />
|
||||
<Component {...rest} setState={updateState} />
|
||||
</ItemWrapper>
|
||||
</div>
|
||||
);
|
||||
|
@ -192,14 +192,14 @@ const MemoizedItem = memo(
|
|||
}
|
||||
);
|
||||
|
||||
const BaseItem = ({ setState, state }) => {
|
||||
const BaseItem = ({ setState, itemId }) => {
|
||||
const selectedItems = useRecoilValue(selectedItemsAtom);
|
||||
const realState = useRecoilValue(ItemsFamily(state.id));
|
||||
const state = useRecoilValue(ItemsFamily(itemId));
|
||||
return (
|
||||
<MemoizedItem
|
||||
state={realState}
|
||||
state={state}
|
||||
setState={setState}
|
||||
isSelected={selectedItems.includes(state.id)}
|
||||
isSelected={selectedItems.includes(itemId)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ const ItemList = () => {
|
|||
const itemList = useRecoilValue(ItemListAtom);
|
||||
|
||||
return itemList.map((item) => (
|
||||
<Item key={item.id} state={{ id: item.id }} setState={updateItem} />
|
||||
<Item key={item.id} itemId={item.id} setState={updateItem} />
|
||||
));
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue