
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
remix-search-param-hooks
Advanced tools
remix-search-param-hooks is a lightweight collection of React hooks designed to simplify the management of URL search parameters in Remix and React Router applications. These hooks provide intuitive ways to read, update, and toggle search parameters, making it easier to keep your application's state synchronized with the URL for enhanced routing and shareability. Ideal for building dynamic, URL-driven interfaces with minimal boilerplate.
A custom React hook for toggling a boolean URL search parameter. It allows you to easily manage boolean states synced with the URL.
key (string): The search parameter key to toggle.options (optional):
caseSensitive (boolean): If true, the comparison will be case-sensitive. Defaults to false.defaultValue (boolean): The initial value if the search parameter is not present. Defaults to false.import { useToggleSearchParam } from "remix-search-param-hooks";
function ToggleComponent() {
const [isOpen, toggleIsOpen] = useToggleSearchParam("open", {
caseSensitive: false,
defaultValue: false,
});
return (
<div>
<button onClick={() => toggleIsOpen()}>Toggle</button>
<button onClick={() => toggleIsOpen(true)}>Open</button>
<button onClick={() => toggleIsOpen(false)}>Close</button>
{isOpen && <div>content</div>}
</div>
);
}
A custom React hook that provides a convenient way to update URL search parameters in Remix and React Router applications. This hook allows you to modify search parameters dynamically, using either a function or an object of key-value pairs.
args (SearchParamMutationArgs):
URLSearchParams and returns a modified instance.string | number | boolean: Sets the value for the key.null: Deletes the parameter.undefined: Skips the key without changes.options (optional NavigateOptions): Options for navigation after updating the parameters.Updating a search param value.
const patchSearchParams = usePatchSearchParams();
const handler = () => {
patchSearchParams({ city: "gothenburg" });
};
Deleting a search param.
const patchSearchParams = usePatchSearchParams();
const handler = () => {
patchSearchParams({ city: null });
};
Updating and deleting.
const patchSearchParams = usePatchSearchParams();
const handler = () => {
patchSearchParams({ city: null, country: "sweden" });
};
Complex update.
const patchSearchParams = usePatchSearchParams();
patchSearchParams((draft) => {
// Draft is a mutable copy of the current search params. No need to clone it.
draft.set("updatedParam", "newValue");
});
A custom React hook that checks if all specified search parameters are present and match the provided conditions in Remix applications. It provides an easy way to validate multiple search parameters in the URL.
query (SearchParamQueryArgs): This can be one of the following types:
Record<string, string | number | boolean | null | undefined>: Checks if the specified key-value pairs exist in the search parameters.string: Checks if the search parameter exists.string[]: Checks if any of the listed parameters exist.(key: string, value: string) => boolean: A function that receives each key-value pair of search parameters and returns a boolean.Checking for a single param key.
const hasEverySearchParam = useHasEverySearchParam();
const hasSearchPhrase = hasEverySearchParam("search");
Checking for multiple param keys.
const hasEverySearchParam = useHasEverySearchParam();
const hasDetailedFilter = hasEverySearchParam(["address", "city"]);
Checking for key value pairs.
const hasEverySearchParam = useHasEverySearchParam();
const hasExactFilter = hasEverySearchParam({
today: true,
city: "stockholm",
});
A custom React hook that checks if any of the specified search parameters are present and match the provided conditions in Remix applications. It provides an easy way to validate the presence of one or more search parameters in the URL.
query (SearchParamQueryArgs): This can be one of the following types:
Record<string, string | number | boolean | null | undefined>: Checks if the specified key-value pairs exist in the search parameters.string: Checks if the search parameter exists.string[]: Checks if any of the listed parameters exist.(key: string, value: string) => boolean: A function that receives each key-value pair of search parameters and returns a boolean.Checking for a single parameter key.
const hasSomeSearchParam = useHasSomeSearchParam();
const hasSearchPhrase = hasSomeSearchParam("search");
Checking for at least one parameter key.
const hasSomeSearchParam = useHasSomeSearchParam();
const hasAnyFilter = hasSomeSearchParam(["address", "city"]);
Checking for at least one key-value pair.
const hasSomeSearchParam = useHasSomeSearchParam();
const hasPartialFilter = hasSomeSearchParam({
today: true,
city: "stockholm",
});
FAQs
Convenient search param hooks for Remix
We found that remix-search-param-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.