reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

ES6 example? #61

Closed ararog closed 8 years ago

ararog commented 8 years ago

Hi,

I'm trying to make use of bar chart in a React app using ES6/Babel, but no matter what I try I'm always getting the following error:

Uncaught TypeError: Cannot read property 'Chart' of undefined

Anyone had this issue before?

ararog commented 8 years ago

In fact this is a webpack related issue, I solved by injection window into module using webpack's import-loader as described here:

http://webpack.github.io/docs/shimming-modules.html#importing

austinpray commented 8 years ago

Can you post your full file? ES6 Works fine for me.