vitalets / react-native-extended-stylesheet

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

The package returns an empty object #134

Closed nateblog closed 4 years ago

nateblog commented 4 years ago

Steps to Reproduce

  1. install the package
  2. import the package import EStyleSheet from 'react-native-extended-stylesheet';
  3. then use it

Expected Behavior

The package EStyleSheet should return an object that contains all the style properties.

Actual Behavior

It returned an empty object

Show the code

import {Dimensions} from 'react-native';
import EStyleSheet from 'react-native-extended-stylesheet';
import {theme} from '../appConfig.json';

const {width} = Dimensions.get('window');
const styles = EStyleSheet.build({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: theme.primary,
  },
  landing_sections: {
    flex: 1,
    width,
    justifyContent: 'center',
    alignItems: 'center',
  },

  appTitleWrapper: {
    backgroundColor: 'red',
    width: '90%',
    height: '25%',
    aspectRatio: 3.5,
    justifyContent: 'center',
    alignItems: 'center',
  },
  appTitle: {
    fontSize: 60,
    fontFamily: 'GoodVibrationsScript',
    textAlign: 'center',
    color: '#fff',
    paddingRight: 10,
  },
});
console.log(styles) <---- EMPTY OBJECT
export default styles;

Environment

"react-native": "0.61.5", "react-native-extended-stylesheet": "^0.12.0",

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

ipakhomov commented 4 years ago

@nateblog I noticed, that you use call EStyleSheet.build({ ...your styles here }) to create styles - this function does not return anything. Please try to create your styles using EStyleSheet.create({ ...styles here }) instead.

Also, maybe this comment may help you?

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.