Now, it is time to create our app, which will consist of a Simple button, of the same sort we used in previous examples. We will use it to show all the features of the CSS modules.
Let's create an index.js file, which is the entry we specified in the webpack configuration, and let's import React and ReactDOM as well:
import React from 'react'; import { render } from 'react-dom';
We can then create a Simple button. As usual, we are going to start with a nonstyled button, and we will add the styles step by step:
const Button = () => <button>Click me!</button>;
Finally, we can render the button into the DOM:
render(<Button />, document.body);
Please note that rendering a React component into the body is bad practice, but ...