Describe the bug
Ok this is a fun one. Basically tsc complains about missing react typings, when trying to use create of @storybook/theming.
This is because:
@storybook/theming imports @emotion/*
- which in turn imports
react
- which in turn requires
@types/react
- which would have to be installed manually
- which would then declare global
JSX namespace
- which would then conflict with the
JSX namespace of Vue
To Reproduce
import { create } from '@storybook/theming';
export default create({
base: 'light',
brandTitle: 'My Storybook',
});
Expected behavior
Use create from @storybook/theming without requiring react typings and therefore no JSX namespace conflicts.
System:
- OS: any
- Device: any
- Browser: any
- Framework: vue
- Version: 5
Additional context
Workaround:
- dont use storybook theming
- or dont use vue jsx/tsx
- or run tsc with
--skipLibCheck
Solution:
- provide a
create theme function/module that does not use @emotion/*
- the only stuff that
create requires from @emotion/* is import { css, keyframes } from '@emotion/core'; in animation.ts)
- where
css type doesnt require react typings (so no problem here), but is imported from @emotion/core types, which imports react typings for other stuff (this is a problem) -> import css from @emotion/css
- where
keyframes type doesnt require react typings (so no problem here), but its type is declared in @emotion/core type declaration file that imports react typings, but actually dont use react typings for keyframes itself (but for other stuff) -> ask for upstream change in emotion (which would maybe require some reorganisation of types/exports on their part) or reimplement/c&p keyframes into @storybook/theming or dont use keyframes during create
Describe the bug
Ok this is a fun one. Basically tsc complains about missing react typings, when trying to use
createof@storybook/theming.This is because:
@storybook/themingimports@emotion/*react@types/reactJSXnamespaceJSXnamespace of VueTo Reproduce
npx tscExpected behavior
Use
createfrom@storybook/themingwithout requiring react typings and therefore no JSX namespace conflicts.System:
Additional context
Workaround:
--skipLibCheckSolution:
createtheme function/module that does not use@emotion/*createrequires from@emotion/*isimport { css, keyframes } from '@emotion/core';inanimation.ts)csstype doesnt requirereacttypings (so no problem here), but is imported from@emotion/coretypes, which importsreacttypings for other stuff (this is a problem) -> importcssfrom@emotion/csskeyframestype doesnt requirereacttypings (so no problem here), but its type is declared in@emotion/coretype declaration file that importsreacttypings, but actually dont use react typings forkeyframesitself (but for other stuff) -> ask for upstream change in emotion (which would maybe require some reorganisation of types/exports on their part) or reimplement/c&pkeyframesinto@storybook/themingor dont usekeyframesduringcreate