jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
282 stars 38 forks source link

Firefox throws "SyntaxError: let is a reserved identifier" #55

Closed dineshvgp closed 9 years ago

dineshvgp commented 9 years ago

react-validation-mixin works fine in chrome but not in firefox. A quick googling resulted in using "babel" to convert ES6 to ES5. I'm new to node framework. Can anyone help me to fix this?

jurassix commented 9 years ago

I'll take a look.

dineshvgp commented 9 years ago

But this demo(http://jurassix.github.io/react-validation-mixin/) works well in firefox. It would be great if I get the source code of that.

jurassix commented 9 years ago

Code for the demo is hidden in plain sight ;) #54

jurassix commented 9 years ago

I searched the lib/ folder that is packaged with this library on npm i react-validation-mixin and find no references to lib.

It seems more likely that your also using ES6 and have introduced let keyword? Check your babel config?

jurassix commented 9 years ago

Ok I re-read your initial post. You need to use babel to transpile your source code into ES5.

Checkout the following from this library to get up and running quick:

.babelrc sets babel options package.json look at the build:lib target and the babel-* deps

And that should do it. In this library the src/ folder is ES2015 and then transpiled to lib/. When you install from node you only pull down the lib/ folder which has the ES5 modules that should work in modern browsers.

Good luck.