stylesuxx / generator-react-webpack-redux

React Webpack Generator including Redux support
Other
552 stars 84 forks source link

jquery param is changed from $ to "p" in the app.js distributed file #43

Closed diegoalmesp closed 8 years ago

diegoalmesp commented 8 years ago

Hello guys! I'm working with jquery to make a post call inside a component.

My problem is that, minimist (I guess) is changing the $ sign to a p. So, in the distributed app.js file I have an error where I make that call, the error is:

Uncaught TypeError: e.post is not a function

When I click on it, the map file shows me the code was:

$.post(...)

Btw, I'm building a component for an existing webpage, so I have to use the jquery that's already there.

I couldn't find any place to add exceptions to minimist. Is there any config file for this? I'm still not sure this is my problem. Maybe I can try something else?

I hope you can help me. Thanks in advance!

diegoalmesp commented 8 years ago

Found it! I'm answering myself again hehe:

the Jquery object was inside window.$ so the react component couldn't find it. so I just added:

let $ = window.$ || {};

at the top of the component file and now it works perfect.

Thanks!