mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
a92a5caec2
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
18 lines
310 B
JavaScript
18 lines
310 B
JavaScript
import React from 'react'
|
|
|
|
export default class Welcome extends React.Component {
|
|
state = { name: null }
|
|
|
|
componentDidMount() {
|
|
const { name } = this.props
|
|
this.setState({ name })
|
|
}
|
|
|
|
render() {
|
|
const { name } = this.state
|
|
if (!name) return null
|
|
|
|
return <p>Welcome, {name}</p>
|
|
}
|
|
}
|