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);
Copy the code

App.module.css

.name {
  padding: 20px;
  font-size: 24px;
  color: red;
}
Copy the code