talyssonoc / react-laravel

Package for using ReactJS with Laravel
896 stars 90 forks source link

es6 #54

Closed vadimsg closed 8 years ago

vadimsg commented 8 years ago

Is someone using this package with es6/export/import? Can't get it to work. If yes, could you provide a simple example? Thanks!

talyssonoc commented 8 years ago

It's something like this other issue, take a look: https://github.com/talyssonoc/react-laravel/issues/20

TomCaserta commented 8 years ago

I am using this with ES2015, I did however have to export the components to the window object since browserify was containing all of my components however a simple:

import {MyComponent} from "./my-component.jsx";

var glob = typeof window !== "undefined" ? window : global;

glob["MyComponent"] = MyComponent;

Worked so I could use it with the laravel elixir browserify/babel recipe. Is this what you was referring to, or are you looking to use it without any transpiling to ES5?