anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.15k stars 558 forks source link

Use it with react #70

Closed lionel95200x closed 7 years ago

lionel95200x commented 7 years ago

Hello I can't use this module with react, the SMA value is undefined when i launch the exemple

Can you help me ? Have you solution to use it with react js ?

Thanks

anandanand84 commented 7 years ago

@lionel95200x sure. are you using some kind of module bundler?

Can you check if this helps

https://github.com/anandanand84/technicalindicators/issues/50#issuecomment-314141400

lionel95200x commented 7 years ago

Yes i use webpack with create react app so i can custom my webpack configs

No i have the same error "browser.js:1 Uncaught ReferenceError: regeneratorRuntime is not defined"

I import this at the top of the file but this not work require('babel-polyfill') const SMA = require('technicalindicators').SMA;

Can you help me ?

lionel95200x commented 7 years ago

I solve this using : const SMA = require('technicalindicators/dist').SMA