@emotion/react | @emotion/styled |
---|---|
major |
major |
TypeScript types have been significantly restructured. These changes:
- reduce build times when using Emotion, especially in larger projects
- in many cases remove the need for manually specifying generic parameters for your Emotion components
- union types as props are better supported and should be inferred properly
css
function has been restricted to prevent passing of invalid typesstyled
's generic parameter has been changed, if you were specifying theComponentType
you will need to remove that generic parameterstyled
no longer takes a secondExtraProps
parameter - instead of that move it to after thestyled
call. So instead of writingstyled<typeof MyComponent, ExtraProps>(MyComponent)({})
you should now be writingstyled(MyComponent)<ExtraProps>({})
If you encounter build issues after upgrade, try removing any manually specified generic types and let them be inferred.