vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

Updating position of child reference to allow CRA compile without plugins #54

Closed grantbi closed 7 years ago

grantbi commented 7 years ago

Was receiving this error prior to updating the source:

Failed to compile.
./node_modules/react-native-extended-stylesheet/src/api.js
Module parse failed: /Volumes/HD/grant/Dev/_ct/mobile/node_modules/react-native-extended-stylesheet/src/api.js Unexpected token (15:8)
You may need an appropriate loader to handle this file type.
|
| export default class \{
|   child = child;
|
|   /**

Moving the declaration below into the constructor fixes this and tests pass. Correct me if I made any mistakes in relocating the placement of this parameter.

Thanks

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.002%) to 99.32% when pulling 61e2e4d3775cabedd4830db1a48df9a9d84ed9fd on grantbi:master into 17ed2008ce75e6abb0cad57e4e3164cd8282c4a7 on vitalets:master.

vitalets commented 7 years ago

Your edit is ok. I'm wondering is not CRA support class fields out of box? By docs it should: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#supported-language-features-and-polyfills