is to prefix styles and avoid style conflicts.
When defining styles in less, they themselves use uniform variables, so in less-loader, I can solve the prefix problem in css by directly giving a variable value of ant-prefix
.
however, when writing className
in js, it also involves the class name. I see that each component has a props value of prefixCls, which has a default value, and I can also pass in the value to change it. However, every time I use a component, I have to send a prefixCls into it. This method is too scary. There should be ways to use it that I don"t know.
so, the question is, if I have changed the value of ant-prefix
in less, is there any way I can uniformly change the corresponding class name in the corresponding js, that is, the value of prefixCls this props?