Giter Club home page Giter Club logo

react-native-fix-inline-styles's People

Contributors

ignacioola avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-fix-inline-styles's Issues

ReferenceError: StyleSheet is not defined

Sorry i speak english not well. Here is log of error.

/Users/nicesoft/Desktop/ReactNative/ReactTools/inline-styles/transform.js:323
const fixedStyles = StyleSheet.create({});
^

ReferenceError: StyleSheet is not defined
at Object.StyleSheet (/Users/nicesoft/Desktop/ReactNative/ReactTools/inline-styles/transform.js:343:21)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Module._compile (/Users/nicesoft/.config/yarn/global/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Object.newLoader [as .js] (/Users/nicesoft/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at setup (/Users/nicesoft/.config/yarn/global/node_modules/jscodeshift/src/Worker.js:80:18)
/Users/nicesoft/Desktop/ReactNative/ReactTools/inline-styles/transform.js:323
const fixedStyles = StyleSheet.create({});
^

ReferenceError: StyleSheet is not defined
at Object.StyleSheet (/Users/nicesoft/Desktop/ReactNative/ReactTools/inline-styles/transform.js:343:21)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Module._compile (/Users/nicesoft/.config/yarn/global/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Object.newLoader [as .js] (/Users/nicesoft/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at setup (/Users/nicesoft/.config/yarn/global/node_modules/jscodeshift/src/Worker.js:80:18)
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.858seconds

Styles with functions don't get fixed

Styles which call functions don't are not moved to fixedStyles, for example:

<View style={{ height: 10, width: vh(10) }} />

Get transformed to:

<View style={[styles.view, { width: vh(10) }]} />

When the width could also be moved to the fixedStyles stylesheet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.