Skip to content

Instantly share code, notes, and snippets.

@whtswrng
Created October 6, 2018 08:24
Show Gist options
  • Save whtswrng/bfd52659ae42b3b3a650bd5aa3b86fe1 to your computer and use it in GitHub Desktop.
Save whtswrng/bfd52659ae42b3b3a650bd5aa3b86fe1 to your computer and use it in GitHub Desktop.
solid-1-bad
class App extends Component {
state = {
users: []
};
async fetchUsers() {
const users = await fetch('http://totallyhardcodedurl.com/stupid');
this.setState({users});
}
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Welcome, this is mine ugly application.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>Save</th>
</tr>
<tr>
<td><input value="Jill"/></td>
<td><input value="Smith"/></td>
<td><input value="50"/></td>
<td><button onClick={() => this.saveRow(0)}>Save</button></td>
</tr>
<tr>
<td><input value="Jill"/></td>
<td><input value="Smith"/></td>
<td><input value="50"/></td>
<td><button onClick={() => this.saveRow(1)}>Save</button></td>
</tr>
</table>
</div>
);
}
saveRow(row) {
// ...
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment