gajus / gajus/babel-plugin-react-css-modules

Cannot Resolve Stylename If not explicitly a String

Abierto
#72 3 comentarios 9 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
JavaScript
Estrellas
2k
Forks
159
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Take the following code snippet:

```
render() {
const appliedStyles = ['one', 'two'];
appliedStyles.push(this.props.a ? 'style-a' : 'style-b');

return (


Hello

);
}
```

What you'll see is that we'll end up getting something like `Unhandled rejection Error: Could not resolve the styleName 'style-a'.`

However, if we change the code ever so slightly to
```


```
then it seems to work.

Is this a Babel constraint or a fixable bug? The pattern works with your [non-babel version](https://github.com/gajus/react-css-modules).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.