Using Preact with Storybook 3
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
Language
English
Hacker News points
None found.