This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
generated from Frc5572/Java-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62fdf2f
commit 184e75f
Showing
6 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<html> | ||
|
||
<head> | ||
|
||
<title>Let’s React with npm</title> | ||
<!-- Load React Libraries | ||
Note: when deploying, replace “development.js” with “production.min.js”. --> | ||
|
||
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script> | ||
|
||
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script> | ||
|
||
|
||
</head> | ||
|
||
|
||
|
||
<body> | ||
|
||
<div id="input-field"></div> | ||
<!-- This is embedded JavaScript. You can even place this in separate .js file --> | ||
|
||
<script> | ||
const element = React.createElement; | ||
|
||
class InputField extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { name: '' }; | ||
} | ||
|
||
render() { | ||
return element('input', { | ||
onChange: e => this.setState({ name: e.target.value }), | ||
value: this.state.name, | ||
type: 'text' | ||
}); | ||
} | ||
} | ||
|
||
const domContainer = document.querySelector('#input-field'); | ||
ReactDOM.render(element(InputField), domContainer); | ||
</script> | ||
</body> | ||
|
||
</html> |