Making a Collatz Conjecture Application: String Output
Learn how to perform computations in a React application and how to style the components.
We'll cover the following...
We'll cover the following...
Preprocessing the values
So far, the attributes and content have just been plugged into the rendering. We can do a lot more by pre-processing the values using the full power of JavaScript. As an example, we use a number to compute a string, which is then rendered.
You can perform as many computations as you like in the render method. In practice, however, this is a bad idea.