S
S
SEACRE5T2021-06-26 13:33:24
React
SEACRE5T, 2021-06-26 13:33:24

How to pass more styles through scss modules in React?

import {category, accessories}  from "./Categories.module.scss";

const Accessories = () => (
    <div className={category, accessories}>
        <BoxButton text="Accessories" />
    </div>
);


I do not understand in className you can only pass one option? Write Unexpected a comma in that place.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-06-26
@SEACRE5T

Option 1
<div className={`${category} ${accessories}`}>
Option 2 - clsx or classnames .
<div className={clsx(category, accessories)}>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question