In this one-hour video tutorial, I'm going to show you how to apply Test-Driven Development to add more features to the existing Payment section ( • React Clean Code - How to Refactoring... ). We'll learn how to identify code smells in it and how to apply small refactorings each time and make the code always in a clean and easy-to-understand state.
01:00 - Intro
01:48 - Intro to a new feature - JP market
14:16 - Japanese Yen
20:57 - Extract new type
26:51 - See the application in the browser
28:50 - New feature - Denmark market
36:27 - All tests are passing now
37:54 - Refactoring currency sign
43:47 - Refactoring the hook and utils
45:22 - High-Order-Functions
50:40 - Math.pow to simplify
01:02:01 - Ending
Subscribe to my newsletter for more articles and videos on refactoring and clean code tips: https://juntao.substack.com/
Additional Resources:
React Anti-Patterns: https://www.amazon.com/React-Anti-Pat...
React Clean Code Book: https://leanpub.com/react-clean-code
Maintainable React Book: https://leanpub.com/maintainable-react
Mastering Maintainable React Course: https://www.udemy.com/course/masterin...
Play it around here: https://codesandbox.io/s/round-up-ref...
Latest Code: https://github.com/abruzzi/round-up-tdd