Refactoring React with Tests

As you work on a React application it’s highly likely that you’ll encounter components that have grown over time. They may have started with just one particular use case in mind, but will have been added to since. This can lead to complex render method…


This content originally appeared on Jack Franklin and was authored by Jack Franklin

As you work on a React application it's highly likely that you'll encounter components that have grown over time. They may have started with just one particular use case in mind, but will have been added to since. This can lead to complex render methods and code that's hard to follow.

In this video you'll see how to spot components that need some work doing, how we test these components, and how we use the tests to guide us, splitting one component into two much more straightforward ones.

PS: it's definitely worth making the video fullscreen or viewing on Youtube so you can see things more clearly.


If you'd like to play with this code, you can find the repository on GitHub, and feel free to raise any questions via GitHub issues on that repository.


This content originally appeared on Jack Franklin and was authored by Jack Franklin


Print Share Comment Cite Upload Translate Updates
APA

Jack Franklin | Sciencx (2017-06-30T00:00:00+00:00) Refactoring React with Tests. Retrieved from https://www.scien.cx/2017/06/30/refactoring-react-with-tests/

MLA
" » Refactoring React with Tests." Jack Franklin | Sciencx - Friday June 30, 2017, https://www.scien.cx/2017/06/30/refactoring-react-with-tests/
HARVARD
Jack Franklin | Sciencx Friday June 30, 2017 » Refactoring React with Tests., viewed ,<https://www.scien.cx/2017/06/30/refactoring-react-with-tests/>
VANCOUVER
Jack Franklin | Sciencx - » Refactoring React with Tests. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2017/06/30/refactoring-react-with-tests/
CHICAGO
" » Refactoring React with Tests." Jack Franklin | Sciencx - Accessed . https://www.scien.cx/2017/06/30/refactoring-react-with-tests/
IEEE
" » Refactoring React with Tests." Jack Franklin | Sciencx [Online]. Available: https://www.scien.cx/2017/06/30/refactoring-react-with-tests/. [Accessed: ]
rf:citation
» Refactoring React with Tests | Jack Franklin | Sciencx | https://www.scien.cx/2017/06/30/refactoring-react-with-tests/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.