ide / react-native-button

A button for React apps
MIT License
773 stars 129 forks source link

Unexpected token #10

Closed niftylettuce closed 9 years ago

niftylettuce commented 9 years ago

How can I patch this with my webpack config?

/node_modules/react-native-button/Button.js Line 18: Unexpected token ...
You may need an appropriate loader to handle this file type.
| var Button = React.createClass({
|   propTypes: {
|     ...TouchableOpacity.propTypes,
|     disabled: PropTypes.bool,
|     style: Text.propTypes.style,
niftylettuce commented 9 years ago

Related? https://github.com/babel/babel/issues/200

niftylettuce commented 9 years ago

I tried using optional: { stage: 0 } in my webpack/babel config but it doesn't work.

niftylettuce commented 9 years ago

See https://github.com/babel/babel-loader/issues/119

niftylettuce commented 9 years ago

See https://github.com/yannickcr/eslint-plugin-react/issues/106#issue-87514714

niftylettuce commented 9 years ago

See https://discuss.reactjs.org/t/spread-operator-enabled-locally-but-not-on-my-ci-server/2078

niftylettuce commented 9 years ago

See https://gist.github.com/dlmanning/d1bc66b50e694d8ebe82

ide commented 9 years ago

You're probably configuring Babel incorrectly. You need to whitelist es7.objectRestSpread at a minimum, and it's a good idea to enable at least the same options that RN's packager does. That's not really an issue with this repo though so closing this out.

niftylettuce commented 9 years ago

I did whitelist it though.. On Oct 19, 2015 12:44 AM, "James Ide" notifications@github.com wrote:

You're probably configuring Babel incorrectly. You need to whitelist es7.objectRestSpread at a minimum, and it's a good idea to enable at least the same options that RN's packager does. That's not really an issue with this repo though so closing this out.

— Reply to this email directly or view it on GitHub https://github.com/ide/react-native-button/issues/10#issuecomment-149096753 .