Skip to content

Unused style detected warning when using object destructuring  #275

Open
@MaxNoack

Description

@MaxNoack

We using destructuring on your StyleSheet.create object you get a "Unused style detected" warning, even though the style is in use. Example:

//This gives no warning
const styles = StyleSheet.create({
  name: {}
});

const Hello = React.createClass({
  render: function() {
    return <Text style={styles.name}>Hello</Text>;
  }
});
//This gives a warning
const { name } = StyleSheet.create({
  name: {}
});

const Hello = React.createClass({
  render: function() {
    return <Text style={name}>Hello</Text>;
  }
});

Excepted behavior should be to pass both versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions