Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@storybook/react-vite
Advanced tools
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
@storybook/react-vite is a package that integrates Storybook with Vite for React projects. It allows developers to build and test UI components in isolation with the fast and modern build tool Vite.
Setup Storybook with Vite
This command initializes a new Storybook configuration in your React project using Vite as the builder. It sets up the necessary files and dependencies to get started with Storybook and Vite.
npx sb init --builder @storybook/react-vite
Writing Stories
This code demonstrates how to write a story for a Button component in a React project. It defines a default export with metadata about the component and creates a template for the story. The `Primary` story is an instance of the template with specific arguments.
import React from 'react';
import { Button } from './Button';
export default {
title: 'Example/Button',
component: Button,
};
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
Running Storybook
This command starts the Storybook development server, allowing you to view and interact with your stories in the browser. It uses Vite for fast builds and hot module replacement.
npm run storybook
@storybook/react is the standard Storybook package for React projects. It uses Webpack as the default builder, which may be slower compared to Vite but is more mature and has broader plugin support.
storybook-builder-vite is another package that integrates Vite with Storybook. It is an alternative to @storybook/react-vite and offers similar performance benefits by leveraging Vite's fast build times.
See documentation for installation instructions, usage examples, APIs, and more.
FAQs
Storybook for React and Vite: Develop React components in isolation with Hot Reloading.
The npm package @storybook/react-vite receives a total of 989,418 weekly downloads. As such, @storybook/react-vite popularity was classified as popular.
We found that @storybook/react-vite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.