DEV Community

Matthew Palmer
Matthew Palmer

Posted on

1

The Great RGB Color Game

In a previous post earlier today, I mentioned working on The Great RGB Color Game originally by Colt Steele. I rebuilt that application in React.js, and you can see a live demo here.

This project was very fun to do, and it did a great job reminding me about using functions in stateless components. The () at the end of a function being called is so important since it executes a function. Without it, functions literally will return the entire function code itself. I also found that passing state down as props became ideal when state turned out to be so dynamic.

The app itself needed the ability to assign colors at random, but even this.setState({ }) could not seem to handle the random assignments. I ended up moving my random/assigning logic to the top level of my application so that I could pass down solid data.

If there is anything I would want my readers to know about a project like this, it should be that vanilla JS is much harder to use in a library if you're not quite sure what's initially happening. However, vanilla JS is still a powerful tool despite the default power of libraries. Never underestimate the power of your roots!

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay