vitalets / react-native-extended-stylesheet

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

No styles created in React Native 0.57.x #100

Closed dphaener closed 6 years ago

dphaener commented 6 years ago

Steps to Reproduce

  1. Create new RN 0.57.x app
  2. Create a stylesheet with EStyleSheet.create
  3. Import into a component and attempt to use it
  4. Get an empty stylesheet.

Try in Expo

Expo doesn't currently run RN 0.57.x

Expected Behavior

I thought I would get a stylesheet

Actual Behavior

I got an empty stylesheet

Show the code

// styles.js
import EStyleSheet from 'react-native-extended-stylesheet';

export const styles = EStyleSheet.create({
  container: {
    flex: 1,
  },
};

// component.js
import { styles } from './styles.js';

export const Component = () => (
  <View style={styles.container}>
  </View>
);

// No styles at all. Works fine with StyleSheet from RN

Environment

React Native Environment Info:
  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 1.51 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.0.0 - /usr/local/bin/node
    Yarn: 1.6.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      Build Tools: 26.0.0
      API Levels: 26, 28
  IDEs:
    Android Studio: 2.3 AI-162.4069837
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.6.0 => 16.6.0
    react-native: 0.57.4 => 0.57.4
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7
vitalets commented 6 years ago

Hi @dphaener ! Did you call EStyleSheet.build()?

dphaener commented 6 years ago

@vitalets Indeed I did! I ended up just removing this library completely, because we were only using it for percentage widths, which is now supported natively. This can be closed from my perspective, unless you want to leave it open for the sake of possibly finding a bug. I'll leave it up to you.

vitalets commented 6 years ago

Ok. I will re-check with RN 57. Thank you!

vitalets commented 6 years ago

Just checked latest react-native-extended-stylesheet@010.0 - it works correctly on RN 0.57.4 on both ios and android.