Tutorial page "Lifting State Up" demo can give incorrect boiling verdict
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Because the Boiling verdict uses the temperature in celsius , if the user puts in fahrenheit 211.9999 this will incorrectly report that it will boil. This is because the conversion to celsius is limited to 3 digits and gets rounded up to 100.

A fix for this is to change BoilingVerdict to accept scale and temperature and the code to do a slightly different check for each:
function BoilingVerdict(props) {
if (props.scale === 'c' ? props.temperature >= 100 : props.temperature >= 212) {
return <p>The water would boil.</p>;
}
return <p>The water would not boil.</p>;
}
<BoilingVerdict
scale={this.state.scale}
temperature={this.state.temperature}
/>

I know that I could do a fork and pull request but this is about as far as my interest in this subject goes so anyone else is free to fix this admittedly tiny issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the “Lifting State Up” tutorial page and locate the BoilingVerdict component and its usage. Check the verdict for Fahrenheit values just below 212, then update the component and confirm that 211.9999 does not report boiling while threshold values still do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100