React official website "status improvement" chapter, according to the source code to knock out the error, where is the problem?

this is the address of this chapter: https://reactjs.org/docs/lift.
Chinese address: http://www.css88.com/react/do.

.

this chapter, called State Enhancement, is about how to use React to achieve a two-way binding, converting input degrees Celsius to Fahrenheit and input Fahrenheit to degrees Fahrenheit.

finally, this error will be reported after typing it out according to the source code

clipboard.png

if (Number.isNaN(input)) {
return "";
}

NaN..

clipboard.png

create-react-app

clipboard.png

Thank you, all React bosses, Trout, please help me ~

If you don't have

Number.isNaN , use babel to change your browser.


send the wrong message. I guess number doesn't have isnan. It depends on your specific environment.

Menu