@emotion/react | @emotion/styled |
---|---|
major |
major |
TypeScript types have been significantly restructured. These changes:
- reduce build times when using Emotion, especially in larger projects
- it's no longer necessary to manually specify generic parameters for your Emotion components in many cases
- union types as props are better supported and should be inferred properly
- the
css
function has been restricted to prevent passing invalid types styled
'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.