CRA
实际上,我继承了一个 ReactJS Web 应用程序,它由Ant-Design初始化。我刚刚使用 Material-UI 并且没有使用And Design的经验。
Material-UI 处理样式的方式很棒,但 AntD 用于less
处理 CSS。我很难像古人一样工作。
我搜索了很多,但没有找到在 Ant Design 项目中使用JSS
[ CSS in JS ] 的方法。
我的意思如下:
import { AntDCompo } from 'antd';
import { Styled , injectStyled } from 'react-jss';
const MyCompo = ({ classes }) => (
<AntDCompo className={classes.container} />
);
const styles = Styled({
container: {
color: '#f00',
},
});
export default injectStyled(styles)(MyCompo);
但是在 Ant Design 文档中只是像古老的东西一样声明:
import { AntDCompo } from 'antd';
import styles from 'myCompoStyles.less';
const MyCompo = () => (
<AntDCompo className={styles.container} />
);
我该怎么做?或者有什么方法可以将 JSS 用于 AndD 组件?