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

How to use Linaria in create react app 2 #285

Closed
sysleaf opened this issue Jan 2, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@sysleaf
Copy link

commented Jan 2, 2019

Do you want to request a feature or report a bug?
Its not a bug or feature but it would be great if it mentioned somewhere on how to use it with create react app.

what configuration need to be changed in order to make it work with create-react-app.
I tried whatever babel preset config was mentioned with craco but I was getting error like below.

Error: Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.

Currently, I am using create-react-app2(with inbuilt typescript support) with craco to provide customised config if create-react-app does not support any thing by default.

@satya164

This comment has been minimized.

Copy link
Member

commented Jan 6, 2019

Linaria requires a webpack loader, so it won't work without ejecting from CRA as CRA doesn't allow you to customize the webpack config.

See https://github.com/callstack/linaria/blob/master/docs/BUNDLERS_INTEGRATION.md#webpack for the setup instructions.

@satya164 satya164 closed this Jan 6, 2019

@Hotell

This comment has been minimized.

Copy link
Contributor

commented Feb 22, 2019

what about providing babel macro to prevent ejecting ?

@satya164

This comment has been minimized.

Copy link
Member

commented Feb 22, 2019

A babel macro will provide very bad UX. See my comments here.

Maybe it'll be nice if someone publishes react-scripts-linaria which we can link to in our docs.

@Hotell

This comment has been minimized.

Copy link
Contributor

commented Feb 22, 2019

thanks for the link to former issue!

Maybe it'll be nice if someone publishes react-scripts-linaria which we can link to in our docs.

Yeah that makes

@drownbes

This comment has been minimized.

Copy link

commented Apr 7, 2019

@sysleaf Check this: https://github.com/drownbes/linaria-cra . I've set up cra with linaria using craco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.