0

Styles not applying from require. Here is sample app, describing the problem: https://github.com/alexshk/react-native-style

Versions:

➜ stylestest git:(master) npm version { stylestest: '0.0.1', npm: '3.8.6', ares: '1.10.1-DEV', http_parser: '2.7.0', icu: '56.1', modules: '48', node: '6.1.0', openssl: '1.0.2h', uv: '1.9.0', v8: '5.0.71.35', zlib: '1.2.8' } 

2 Answers 2

1

Because you're using ES5 require with ES6 export syntax, you should either change

var styles = require('./styles') 

to

import style from ./styles' 

or change

export default StyleSheet.create(...) 

to

module.exports = StyleSheet.create(...) 
Sign up to request clarification or add additional context in comments.

Comments

0

Figured it myself:

I was using export default StyleSheet.create({ instead of module.exports = StyleSheet.create({

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.