1.0.1 • Published 3 years ago

hplib-classname v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

跟 classNames 组件类似,但是会为每个 className 自动增加前缀。

主要用在开发公共组件时,需要前缀区分的时候

import React from "react";
import { getPrefixClassNames } from "./prefix-classname";

const classNames = getPrefixClassNames("abc");

const App = () => {
  return <div className={classNames("root")}>实际使用的className为:abc-root</div>;
};