V
V
Vitaly Kirenkov2015-09-09 14:24:12
Less
Vitaly Kirenkov, 2015-09-09 14:24:12

Is it possible to store styles in React LESS next to Components (JSX) and compile at the time of component loading?

The subject in a question actually.
Or, can someone suggest a different approach. The situation is such that the project is large and the styles are already 3-4 meters, and they grow further... Does anyone have any thoughts?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Antropov, 2015-09-09
@Laiff

If, for example, webpack is used to build the project, then it is quite possible to do so. css-loader and less-loader are added, and after that you can write directly in the component

var style = require('./componentStyle.less');
// или если используется 
import style from './componentStyle.less'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question