A React Take on The Notorious B.I.G.’s 10 Crack Commandments

Stan Bershadskiy
Aug 9, 2017 · 3 min read

Great music is timeless. Often times, great rap lyrics can still be relevant today and even re-interpreted to fit other topics. What if we take a great song, such as Ten Crack Commandments by The Notorious B.I.G. and apply it to starting off with React development? Allow me to help you get your game on track, and not your wig pushed back.

Keep the props that your component expects to a minimum and make sure you use them individually. Do not just blindly spread the props object as you may cause unnecessary re-renders.

Keep your components generic enough that they solve only one view element, really well. If your components are small and flexible, then they will not be pigeonhole’d and able to be composed into larger units.

Maintain an extremely high code coverage through automated testing and use static code analysis tools such as ESLint to make sure your classes are written and performing to the highest standard.

Do not try to create every single component or feature on your own. Chances are there’s an implementation available from the open source community that may be better written, tested, and supported.

It may be tempting to repeat known patterns that you applied earlier for a new feature. Do not unless it’s necessary, take a moment and see if there’s a better approach that may be a bit more challenging but worthwhile.

This applies to when you’re building a team around React and its ecosystem. The libraries and practices that you will be leveraging are constantly changing. You may have experienced developers on your team, but if they’re stubborn and unwilling to learn they may not be an ideal fit for the role that their seniority implies.

When developing your application separate your concerns. Simply put, keep your business logic out of the view layer.

Your render() method should be as lightweight and fast as possible.

This relates more to the tech community today. Don’t get into heated discussions or debates with developers who use competing frameworks and libraries, it’s never productive.

Don’t jump at every new and shiny library that is coming out. While you’re still getting comfortable with React and its ecosystem, focus on making sure you have a good grasp of the core library and whatever else you are using. Afterwards you can make educated decisions on changing the tooling.

These interpretations came out of a talk I did at NYC.JS on Migrating Web Apps to React. You can see the slides below. If you think I’m dead wrong (get it?) about some of these or have some ideas of your own please post them in the comments below.

Modus Create: Front End Development

Tutorials, tips, and walk-throughs on web & mobile…

Modus Create: Front End Development

Tutorials, tips, and walk-throughs on web & mobile enterprise applications. JavaScript, HTML5, ReactJS, React Native, Angular, iOS, Android. From the developers at www.moduscreate.com

Stan Bershadskiy

Written by

Web/Mobile/Hybrid/Mobile Web/<BuzzwordHere> | Kentik | React Native Cookbook author http://a.co/90jjS2B

Modus Create: Front End Development

Tutorials, tips, and walk-throughs on web & mobile enterprise applications. JavaScript, HTML5, ReactJS, React Native, Angular, iOS, Android. From the developers at www.moduscreate.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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