0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

reactでクラスを複数付与したい

Posted at
sample.js
className={`mt-3など ${classes.付与したいクラス名}`}

上記でちゃんと動いた。
以下のやり方もあるみたいだけど動かず…。
ライブラリ由来のクラス名と自分でつけたクラス名が混ざってるからかな?
別の場合で使えるかもしれないので一応記載しておく。

sample.js
className={'クラス名' + ' ' + 'クラス名'}

className={classes.クラスA + " " + classes.クラスB}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?