Giter VIP home page Giter VIP logo

Comments (8)

jamiebuilds avatar jamiebuilds commented on May 1, 2024

This doesn't seem to be relevant to this repo at all. It's not actionable so closing...

from babel-plugin-react-transform.

jonstuebe avatar jonstuebe commented on May 1, 2024

@thejameskyle should I post it on react router? It's a project used by most react devs and unless I'm wrong doesn't currently work with this transform tool which seems like a huge issue.

from babel-plugin-react-transform.

jamiebuilds avatar jamiebuilds commented on May 1, 2024

Provide something that shows this babel plugin breaking react router and I'll reopen

from babel-plugin-react-transform.

jonstuebe avatar jonstuebe commented on May 1, 2024

@thejameskyle https://github.com/jonstuebe/react-transform-boilerplate

from babel-plugin-react-transform.

jamiebuilds avatar jamiebuilds commented on May 1, 2024

Okay... now can you make that a more reduced test case? Theres a whole lot of noise in that repo and I'm not going to go through all of it

from babel-plugin-react-transform.

jonstuebe avatar jonstuebe commented on May 1, 2024

The specific command is npm start. I stripped down most of the code so it's really just the <RouterContainer> being rendered with only one component inside of it: <App>. All the rest of the code in the repo hasn't been touched.

from babel-plugin-react-transform.

gaearon avatar gaearon commented on May 1, 2024

The problem in your code is incorrect usage of import and export.
You use export default for App and RouterContainer, but later you use named imports:

// RouterContainer.js
// import { App } from './App'; <--- wrong way to import a default export
import App from './App'; // <--- what it should be

// index.js
// import { RouterContainer } from './RouterContainer'; <--- wrong way to import a default export
import RouterContainer from './RouterContainer'; // <--- what it should be

This is a very good guide explaining the difference between default and named exports.

That said I don't quite understand why this issue was filed in this repository. If you turn off this Babel plugin the issue stays exactly the same. Therefore it's unrelated, and it would've been best to ask on StackOverflow rather than in an unrelated repository. :-)

I hope this helps!

from babel-plugin-react-transform.

jonstuebe avatar jonstuebe commented on May 1, 2024

Makes sense. Thanks!

from babel-plugin-react-transform.

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.