change params to search

This commit is contained in:
PhilReact 2025-03-15 15:57:33 +02:00
parent dcfe746b5b
commit e5eff9827a
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "qapp-core",
"version": "1.0.3",
"version": "1.0.4",
"description": "Qortal's core React library with global state, UI components, and utilities",
"main": "dist/index.js",
"module": "dist/index.mjs",

View File

@ -45,7 +45,7 @@ interface DefaultLoaderParams {
}
interface BaseProps {
params: QortalSearchParams;
search: QortalSearchParams;
listItem: (item: ListItem, index: number) => React.ReactNode;
styles?: ResourceListStyles;
loaderItem?: (status: "LOADING" | "ERROR") => React.ReactNode;
@ -73,7 +73,7 @@ interface NonVirtualizedProps extends BaseProps {
type PropsResourceListDisplay = VirtualizedProps | NonVirtualizedProps;
export const MemorizedComponent = ({
params,
search,
listItem,
styles = {
gap: 1,
@ -91,7 +91,7 @@ export const MemorizedComponent = ({
const { fetchResources } = useResources();
const { getTemporaryResources, filterOutDeletedResources } = useCacheStore();
const [isLoading, setIsLoading] = useState(false);
const memoizedParams = useMemo(() => JSON.stringify(params), [params]);
const memoizedParams = useMemo(() => JSON.stringify(search), [search]);
const addList = useListStore().addList
const addItems = useListStore().addItems
const getListByName = useListStore().getListByName
@ -315,7 +315,7 @@ function arePropsEqual(
prevProps.disableVirtualization === nextProps.disableVirtualization &&
prevProps.direction === nextProps.direction &&
prevProps.onSeenLastItem === nextProps.onSeenLastItem &&
JSON.stringify(prevProps.params) === JSON.stringify(nextProps.params) &&
JSON.stringify(prevProps.search) === JSON.stringify(nextProps.search) &&
JSON.stringify(prevProps.styles) === JSON.stringify(nextProps.styles)
);
}