Skip to content

Instantly share code, notes, and snippets.

@mohandere
Created May 30, 2018 10:50
Show Gist options
  • Save mohandere/9014d7a449fa1d8ff47919a8dcef10e7 to your computer and use it in GitHub Desktop.
Save mohandere/9014d7a449fa1d8ff47919a8dcef10e7 to your computer and use it in GitHub Desktop.
App.js - Obfuscate CSS class names in Create React App without eject
// File - src/App.js
import React, { Component } from 'react';
import logo from './logo.svg';
import Link from './Link';
import styles from './App.css';
class App extends Component {
render() {
return (
<div className={styles.App}>
<header className={styles.AppHeader}>
<img src={logo} className={styles.AppLogo} alt="logo" />
<h1 className={styles.AppTitle}>Welcome to React</h1>
</header>
<p className={styles.AppIntro}>
2 get started, edit <code>src/App.js</code> and save to reload.
</p>
<Link />
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment