Salted Bytes
Published in

Salted Bytes

# config.js
export const DEV = true;

# your-component.js
import { DEV} from '../config';

const YourComponent = () => {
// Your code
if(DEV) {
console.log('Logging')
}
}

export default YourComponent;
"env": {
"production": {
"plugins": ["transform-remove-console"]
}
}

--

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
James Best

James Best

Tech and photography loving developer @candideTech. A host on the @salted-bytes

More from Medium

A Quick Overview of Learning React

Difference Between React and React Native — Geekstrick

ReactJS VS React Native: Key Differences