This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onToleranceChange(event) { | |
setTolerance(Number(event.target.value)); | |
} | |
function onGuessChange(event) { | |
setGuess(Number(event.target.value)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [tolerance, setTolerance] = React.useState(0.001); | |
const [initial_guess, setGuess] = React.useState(-4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form onSubmit={handleSubmit}> | |
<label> | |
Tolerance: | |
<input name="tolerance" type="number" value={tolerance} onChange={onToleranceChange}/> | |
</label> | |
<label> | |
Initial guess: | |
<input name="initial_guess" type="number" value={initial_guess} onChange={onGuessChange}/> | |
</label> | |
<input type="submit" value="Submit" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Root finding web application</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Heading() { | |
const title = 'Root finding web application'; | |
return <h1>{title}</h1> | |
} | |
ReactDOM.render( | |
<Heading/>, | |
document.getElementById('container') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReactDOM.render( | |
<Heading/>, | |
document.getElementById('container') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Heading() { | |
const title = 'Root finding web application'; | |
return React.createElement('h1', null, `{title}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Heading() { | |
const title = 'Root finding web application'; | |
return <h1>{title}</h1> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Example React application</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script> | |
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
</head> | |
<script type="text/javascript" src="newtonraphson.js"></script> | |
<script type="text/babel" src="app.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="newtonraphson.js"></script> | |
<script type="text/babel" src="app.js"></script> |