Giter VIP home page Giter VIP logo

Comments (9)

johanholmerin avatar johanholmerin commented on May 26, 2024 1

Yes, it won't work with CRA. You should be able to get it to work with react-app-rewired, rescripts, craco, or react-scripts-rewired using the Webpack setup, although I haven't tried it.

from style9.

johanholmerin avatar johanholmerin commented on May 26, 2024

To use it with Next.js or Gatsby you would need to use a custom webpack config and then add the plugin as per the README. I have opened an issue about creating plugins, with would make this unnecessary.

CRA doesn't support plugins so you can't use this package with it.

Anything else I can improve about the documentation?

from style9.

danilowoz avatar danilowoz commented on May 26, 2024

Plugins would be an awesome solution.
Let me know when I can take a look at this again, cheers!

from style9.

johanholmerin avatar johanholmerin commented on May 26, 2024

Next.js & Gatsby plugins have now been added

from style9.

danilowoz avatar danilowoz commented on May 26, 2024

I just added Next plugin, and I also need to set the babel plugin (I don't know if it's expected), but it isn't clear to me how to use it. I was able to get the className, but style itself wasn't injected in the page. Am I missing something?

from style9.

johanholmerin avatar johanholmerin commented on May 26, 2024

No, you should not need to use the babel plugin. I created an example repo, style9-nextjs-example, that shows how to use it. If you look at the last commit it shows the necessary steps. Does that help?

from style9.

danilowoz avatar danilowoz commented on May 26, 2024

Really awesome, works like a charm!

from style9.

johanholmerin avatar johanholmerin commented on May 26, 2024

Great. If you are interested I also have an experimental babel macro that adds the styled-components API and support for inline styles.

from style9.

trangcongthanh avatar trangcongthanh commented on May 26, 2024

So if I want to use style9 with CRA, I need to eject it or customize webpack config, right?

from style9.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.