Preact: Incompatible with new Storybook 4.0+

Created on 30 Nov 2018  路  3Comments  路  Source: preactjs/preact

https://github.com/storybooks/storybook/issues/4796

Storybook requires a module called emotion which imports createContext from react

When we use preact, this module throws an error because the preact-compat mapping for createContext over to preact for imports from 'react' is not compatible with the new Storybook version

Any chance this will be fixed?

Most helpful comment

Hey @skaraman, I'm working on a specific @storybook/preact version so we no longer have to patch the storybook runtime with preact-compat. I hope to have it finished in the coming days.

Edit: I opened the pull request with storybook: https://github.com/storybooks/storybook/pull/4912

All 3 comments

Hey @skaraman, I'm working on a specific @storybook/preact version so we no longer have to patch the storybook runtime with preact-compat. I hope to have it finished in the coming days.

Edit: I opened the pull request with storybook: https://github.com/storybooks/storybook/pull/4912

@BartWaardenburg feel free to drop a message into the preact slack chat if you run into anything or are looking for help!

This issue has been resolved with recent versions of Storybook (I'm using 4.1.4).

FYI, some add-ons do not support Preact like "Add-Info" and must be uninstalled and removed from story.jsx files

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zashy picture Zashy  路  3Comments

KnisterPeter picture KnisterPeter  路  3Comments

matthewmueller picture matthewmueller  路  3Comments

SabirAmeen picture SabirAmeen  路  3Comments

mizchi picture mizchi  路  3Comments