We all start with writing a bunch of
console.log() statements in our work-in-progress React components. But then, you find yourself tracking these guys down because it’s not great to have users see all the console logs in a production app.
Here, we’ll see that with a little structure we can start transforming a bad habit into a powerful best practice.
Let’s quickly create a React app to play with, using
create-react-app and Typescript:
yarn create react-app --template typescript react-logging-start
We can now start playing around in
src/App.tsx and add our usual