Last active
December 29, 2017 18:01
-
-
Save peterj/a9181f38daef70b7409b5763eecb098f to your computer and use it in GitHub Desktop.
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
import React, { Component } from 'react'; | |
class CreateShortLink extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
description: '', | |
url: '', | |
}; | |
} | |
createShortLink = async () => { | |
// Create a short link here. | |
}; | |
render() { | |
return ( | |
<div> | |
<input | |
id="url" | |
type="text" | |
value={this.state.url} | |
placeholder="Link URL" | |
onChange={e => this.setState({ url: e.target.value })} | |
/> | |
<input | |
id="description" | |
type="text" | |
value={this.state.description} | |
placeholder="Link description" | |
onChange={e => | |
this.setState({ description: e.target.value }) | |
} | |
/> | |
<button onClick={() => this.createShortLink()}>Create</button> | |
</div> | |
); | |
} | |
} | |
export default CreateShortLink; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment