Home / Companies / Netlify / Blog / Post Details
Content Deep Dive

Using Preact with Storybook 3

Blog post from Netlify

Post Details
Company
Date Published
Author
Netlify
Word Count
474
Company Posts That Month
3
Language
English
Hacker News Points
-
Post removed?
No
Summary

Preact is utilized to achieve React-like component architecture with a smaller bundle size, which is particularly beneficial for applications like Netlify's embeddable identity-widget. To work on UI components in isolation using Storybook, which is primarily built for React, developers can employ the preact-compat library that bridges Preact with React's API. By configuring Webpack to replace React and react-dom with preact-compat, developers can set up Storybook with Preact-based projects. This involves installing necessary dependencies, setting up Storybook's configuration files, customizing Webpack to resolve React imports to preact-compat, and writing component stories. Once configured, running Storybook allows developers to view and test Preact-based UI components independently, which simplifies handling error paths, validations, and edge cases.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.