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

What is the best way of handling conditional styles together with this plugin?

オープン
#253 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2k
フォーク
159
PR マージ指標
30日以内にマージされた PR はありません

説明

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;
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

issue 内の functional component の例と、それに関連する Modal.module.scss スタイルシートを確認してください。issue では、コード変更、対象ファイル、またはテストの特定ではなく、使用方法のガイダンスが求められているため、現時点では具体的な完了条件はありません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。