V
V
volucris12021-04-10 14:20:06
React
volucris1, 2021-04-10 14:20:06

How to define more than one css module class in React?

import root from './root.module.scss';

      <header className={root.classFirst, root.classSecond}>


How to define 2 classes at once?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hellcaster, 2021-04-10
@volucris1

If they are strings, then just

const root = {
  classFirst: `foo`,
  classSecond: `bar`,
};

<header className={`${root.classFirst} ${root.classSecond}`} />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question