/plushcap/analysis/netlify/2018-01-17-using-preact-with-storybook-3

Using Preact with Storybook 3

What's this blog post about?

This text discusses how to use Preact, a smaller alternative to React, with Storybook 3. The key is using preact-compat, which provides a wrapper around Preact that mimics the API of react and react-dom libraries. To set up Storybook with preact-compat, install storybook and preact-compat, create a .storybook/config.js file with standard storybook config, and extend storybook's config to use the Preact based loader by creating a .storybook/webpack.config.js file. Finally, write stories in a stories/index.js file and add a storybook script in the package.json file.

Company
Netlify

Date published
Jan. 17, 2018

Author(s)
Netlify

Word count
474

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.