Closed Yeti-or closed 6 years ago
I think this is okay:
const classesInseteadOfTags = function(jsx, json) {
if (jsx.bemEntity) {
jsx.tag = pascalCase(jsx.tag);
}
};
or more like:
const classesInseteadOfTags = function(jsx, json) {
if (jsx.bemEntity) {
jsx.tag = jsx.bemEntity.elem ? jsx.bemEntity.id : pascalCase(jsx.bemEntity.id);
}
};
Please pass this as a function in options. Please DON'T use bemEntity.id as naming stringify function.
@zxqfox I will use pascalCase(bemEntity.toString())
is it okay for you?
cause I need to get BlockElem
string
Or do you prefer ${pascalCase(bemEntity.block)}${pascalCase(bemEntity.elem)}
?
The second one.
as it done here: https://github.com/Yeti-or/bemjson-to-jsx-loader/blob/master/index.js#L115