crate-react-app 之 css modules

react

App.js

import React, { Component } from 'react';

import CSSModules from 'react-css-modules';

import styles from './App.module.css';

class App extends Component {

render() {

return (

<div styleName="name">

xu

</div>

);

}

}

export default CSSModules(App, styles);

App.module.css

.name {

padding: 20px;

font-size: 24px;

color: red;

}

以上是 crate-react-app 之 css modules 的全部内容, 来源链接: utcz.com/z/383636.html

回到顶部