Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRA Typescript: CreateStyled and styled in @emotion/styled/marco doesn't work #1754

Closed
albusphan opened this issue Feb 7, 2020 · 2 comments
Labels

Comments

@albusphan
Copy link

Current behavior:
Using CreateStyled and styled from @emotion/styled in my CRA Typescript project keep throw error:
Error: Component selectors can only be used in conjunction with babel-plugin-emotion.

Code :

import styled, { CreateStyled } from '@emotion/styled'

import { Theme } from './index'

export default styled as CreateStyled<Theme>

Environment information:

  • react version: 16.12.0
  • emotion version: 10.0.27

Note: The styled will work if using standalone in a component

@Andarist
Copy link
Member

Andarist commented Feb 7, 2020

This, unfortunately, doesn't work with pure TS in emotion 10. There are no plans to fix it because we have chosen other way of customizing the Theme type in the upcoming v11 (already available on npm and very much usable!):
#1606 (comment)

I would recommend migrating to v11 if you are interested in this.

@Andarist
Copy link
Member

Closing because of what has been stated in the above comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants