vitalets / react-native-extended-stylesheet

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

0.11.0 breaks array styles #103

Closed rmevans9 closed 5 years ago

rmevans9 commented 5 years ago

Steps to Reproduce

Create a style with a transform

StyleSheet.create({
    transform: [{ rotate: '45deg' }]
})

Try in Expo

https://snack.expo.io/ByFeEa0kN - Working on 0.10.0 https://snack.expo.io/SkQZETAJV - Not working on 0.11.0

Expected Behavior

Transforms should work.

Actual Behavior

Transforms are not working (locally they even redbox)

Show the code


import React, { Component } from 'react';
import { Text, View } from 'react-native';
import EStyleSheet from 'react-native-extended-stylesheet';

export default class MyComponent extends Component {
  render() {
    return (
      <View style={styles.column}>
        <Text style={styles.header}>Welcome to Extended StyleSheet!</Text>
      </View>
    );
  }
}

const styles = EStyleSheet.create({
  header: {
    fontSize: '1.5rem',
    color: '$fontColor',
    textAlign: 'center',
    backgroundColor: 'red',
    transform: [{ rotate: '45deg' }]
  },
  column: {
    width: '80%',
    height: '60%',
    marginHorizontal: '10%',
    marginTop: '20%',
    backgroundColor: '$bgColor',
    flexDirection: 'column',
    justifyContent: 'center',
    padding: 5,
  }
});

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14.1
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 29.30 MB / 16.00 GB
      Shell: 5.6.2 - /usr/local/bin/zsh
    Binaries:
      Node: 8.14.0 - ~/.nvm/versions/node/v8.14.0/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.14.0/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: 23.0.1, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.2, 27.0.3
        API Levels: 23, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^4.0.12 => 4.0.12
      react: 16.6.1 => 16.6.1
      react-native: ^0.57.7 => 0.57.7
    npmGlobalPackages:
      react-native-cli: 2.0.1
vitalets commented 5 years ago

@rmevans9 Thanks for report! Hot-fixed and released as 0.11.1. Also improved tests for checking array props.