Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused style detected warning when using object destructuring #275

Open
MaxNoack opened this issue Nov 9, 2020 · 0 comments
Open

Unused style detected warning when using object destructuring #275

MaxNoack opened this issue Nov 9, 2020 · 0 comments

Comments

@MaxNoack
Copy link

MaxNoack commented Nov 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant