Emotion: Create codemod to remove withTheme and change ThemeProvider import

Created on 29 Sep 2017  路  6Comments  路  Source: emotion-js/emotion

Since theming is built into styled now as of version 8 we need a codemod for users who rely on withTheme throughout their apps.

import { withTheme } from 'theming'

const A = withTheme(styled('a')`
  color: blue;
`)

Should convert to this

const A = styled('a')`
  color: blue;
`
import { ThemeProvider } from 'theming'

Should convert to this

import { ThemeProvider } from 'emotion-theming'
feature request

All 6 comments

Is this still needed? I'm happy to help out if it is...

Not sure, seems like it's a little bit outdated at this point in time. OTOH there still might be people using older emotion.

I'll await further instructions.

I'm really not sure this is still needed because most of our users have come after emotion 8 & 9 were released. I'm not against creating it, but its not a priority in my mind so I'll close the issue.

Thanks for looking at this @TejasQ

Was this page helpful?
0 / 5 - 0 ratings