gajus / gajus/babel-plugin-react-css-modules
What is the best way of handling conditional styles together with this plugin?
- Lingua principale
- JavaScript
- Stelle
- 2k
- Fork
- 159
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
First off, thanks you for this amazing library. It solves a huge problem and really cleans up my code. I know it's a matter of opinion but I'm curious what the most idiomatic / readable / cleanest way to handle conditional styles together with this plugin? Here's my current approach with a functional component. Does anyone have any other patterns?
```
import React from 'react';
import './Modal.module.scss';
const Modal = (props) => {
const animateModal = () => {
if (props.show === true) {
return('modal animate-in');
}
return('modal animate-out');
}
return (
{props.children}
);
};
export default Modal;
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.