Patch Changes
-
58dc08a6
#1837 Thanks @arcanis! - Fixed TS compatibility under PnP environments by making@types/react
an optional peer dependency. -
f57a7229
#1941 Thanks @Andarist! - The way in which we provide TypeScript support forcss
prop has changed. Based on usage of our jsx pragma we are able to add support forcss
prop only for components that supportclassName
prop (as ourjsx
factory function takes providedcss
prop, resolves it and pass the generatedclassName
to the rendered component). This has been implemented using technique described here. What is important - we no longer extend any global interfaces, so people shouldn't bump anymore into type conflicts for thecss
prop when using different libraries with thecss
prop support, such asstyled-components
.However, it's not possible to leverage
css
prop support being added conditionally based on a type of rendered component when one is not using our jsx pragma. For those cases when people use our pragma implicitly (for example when using our@emotion/babel-preset-css-prop
) we have added special file that can be imported once to add support for thecss
prop globally, for all components. Use it like this:import {} from '@emotion/react/types/css-prop'
In this particular case we are forced to extend the existing
React.Attributes
interface. Previously we've been extending bothReact.DOMAttributes<T>
andJSX.IntrinsicAttributes
. This change is really minor and shouldn't affect any consuming code. -
Updated dependencies [
4d3b60d0
,58dc08a6
,6d32d82b
]:- @emotion/styled@11.0.0-next.14
- @emotion/css@11.0.0-next.14
- @emotion/server@11.0.0-next.14