github emotion-js/emotion @emotion/react@11.0.0-next.14

latest releases: @emotion/styled@11.11.5, @emotion/serialize@1.1.4, @emotion/is-prop-valid@1.2.2...
pre-release3 years ago

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 for css prop has changed. Based on usage of our jsx pragma we are able to add support for css prop only for components that support className prop (as our jsx factory function takes provided css prop, resolves it and pass the generated className 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 the css prop when using different libraries with the css prop support, such as styled-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 the css 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 both React.DOMAttributes<T> and JSX.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

Don't miss a new emotion release

NewReleases is sending notifications on new releases.