Coder Social home page Coder Social logo

Comments (2)

dreyescat avatar dreyescat commented on June 30, 2024

Not sure if I can help but here you have some thoughts:

  • I am pretty sure it is a webpack configuration issue.
  • I bet it is the second part of the message that causes the error you have multiple copies of React loaded. Can you check in the generated app bundled file if you have React library twice? And how many times in your component library?
  • If I have not misunderstood, you are creating your own component library that is imported and used from your app. Maybe you are not excluding React from your library (check how I do this in webpack.config). If you do not exclude it from your library then you can have it twice. One coming from your app and the other from your library.

In pull request #40 the src was included so you can re-webpack at your will. I have never tried but it means you can import the Rating component directly into your component library as if it was yours without having to use it as a library.

Hope it helps!

from react-rating.

litil avatar litil commented on June 30, 2024

Thanks for your answer @dreyescat, I fixed the issue by adding this to my webpack configuration file:
resolve: { ... alias: { 'react' : path.resolve(__dirname, 'node_modules/react') } }

By doing so, I'm telling the application to load react from a specific path. It won't try to load react from my library.

from react-rating.

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.