Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@storybook/addon-queryparams
Advanced tools
This Storybook addon can be helpful if your components need special query parameters to work the way you want them to. It allows you to mock query params per story so that you can easily reproduce different states of your component.
First, install the addon.
$ npx storybook@latest add @storybook/addon-queryparams
In your story, define the query parameters you want to mock via the query
special parameter:
import React from "react";
import { Button } from "../Button";
export default {
component: Button,
parameters: {
query: {
// example of mocking ?greeting="Hello world!"
greeting: "Hello world!",
},
},
};
export const WithMockedSearch = {
render: () => {
const urlParams = new URLSearchParams(document.location.search);
const mockedParam = urlParams.get("greeting");
return <div>Mocked value: {mockedParam}</div>;
}
}
While this addon was part of the Storybook monorepo, it received commits from the following authors:
Andrew Lisowski, Brody McKee, Clément DUNGLER, Filipp Riabchun, Gaëtan Maisse, Gert Hengeveld, Jon Palmer, Lynn Chyi, Michael Shilman, Norbert de Langen, Paul Rosania, Renovate Bot, Tom Coleman, Varun Vachhar, Yann Braga
FAQs
addon to mock queryparams in storybook
The npm package @storybook/addon-queryparams receives a total of 37,905 weekly downloads. As such, @storybook/addon-queryparams popularity was classified as popular.
We found that @storybook/addon-queryparams demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.