DEV Community

Glenn Stein
Glenn Stein

Posted on

Lifting State Up in Docs is scientifically incorrect

In the React Documentation, under the "MAIN CONCEPTS" heading, Part 10 is Lifting State Up.

The example begins by creating the function BoilingVerdict. Based on the input temperature, will the water boil? It returns either "The water would boil." or "The water would not boil."

If you enter 100 degrees Celsius, it correctly displays "The water would boil." If you enter 99, it correctly displays "The water would not boil." If you enter any number greater than 100, e.g., 105, it still displays "The water would boil." This is incorrect. The boiling point of water is 100 degrees Celsius. If liquid water reaches 100 degrees, it boils and becomes water vapor. It will not boil at 105 degrees. At 105 degrees, it will have already boiled; it is all water vapor.

An easy fix would be to simply change the '>= 100' to '== 100'. A more cumbersome fix would be to add text similar to the following: "For the purpose of this example, water boils at any temperature greater than 100 degrees Celsius."

Top comments (0)