2021-11-16 17:53:34 +01:00

19 lines
492 B
JavaScript

import React from 'react'
import { connect } from 'umi'
import { PostsFeed } from 'components'
@connect(({ app }) => ({ app }))
export default class Post extends React.Component{
state = {
postID: null
}
componentDidMount(){
this.setState({ postID: new URLSearchParams(location.search).get('key') })
}
render(){
if (!this.state.postID) {
return null
}
return <PostsFeed from="post" fromID={this.state.postID} />
}
}