You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the types output by Primer React, many components are augmented by the Emotion library, which is a transitive dependency of Storybook. This means that an app consuming Primer React can not be compiled unless skipLibCheck: true is enabled or the app contains the same Emotion dependency via some other means.
For example, in the build output, lib/Button/ButtonClose.d.ts contains the following type augmentation:
Install and use @primer/react in any project without other dependencies.
Run the TypeScript compiler with skipLibCheck: false.
Expected behavior
The compiler will pass.
Additional context
I haven't searched exhaustively, but I believe there are other types imported by surprise. For example, hoist-non-react-statics also appears in exported types.
Actual behavior
The compiler complains that it can't find types for @emotion/core.
I think the correct solution for this would be to move Primer React's storybook stories and all of the related dependencies into a separate package within this repository.
The text was updated successfully, but these errors were encountered:
Describe the bug
In the types output by Primer React, many components are augmented by the Emotion library, which is a transitive dependency of Storybook. This means that an app consuming Primer React can not be compiled unless
skipLibCheck: true
is enabled or the app contains the same Emotion dependency via some other means.For example, in the build output,
lib/Button/ButtonClose.d.ts
contains the following type augmentation:The reason that this augmentation appears is that the
@emotion/core
package, specifically, globally augments theDOMAttributes
interface exported by React:To Reproduce
Steps to reproduce the behavior:
skipLibCheck: false
.Expected behavior
The compiler will pass.
Additional context
I haven't searched exhaustively, but I believe there are other types imported by surprise. For example,
hoist-non-react-statics
also appears in exported types.Actual behavior
The compiler complains that it can't find types for
@emotion/core
.I think the correct solution for this would be to move Primer React's storybook stories and all of the related dependencies into a separate package within this repository.
The text was updated successfully, but these errors were encountered: