-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample.js
39 lines (38 loc) · 837 Bytes
/
Example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, { Component } from 'react'
class Example extends Component {
static defaultProps = {
initial: 'value',
isReal: false,
cars: [
{
name: 'Fox Turbo',
model: 'FANCY286',
year: 2017
},
{
name: 'Not Fox',
model: 'RIGIDbody',
year: 'last year'
}
]
}
handleSubmit = e => {
e.preventDefault()
alert`These colors are awesome, ${e.target.value}! 👍`
}
render() {
return (
<article className="exemplified">
<h2>Here's your cars, sir!</h2>
<pre>
{this.props.cars}
</pre>
<form onSubmit={this.handleSubmit}>
<label htmlFor="name">What's your name?</label>
<input type="text" id="name" />
</form>
</article>
)
}
}
export default Example