Created
April 7, 2017 18:05
-
-
Save anonymous/c03c80149a193611e0729319c8f78e74 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 Layout from '../components/Layout'; | |
class SSRTest extends React.Component { | |
static async getInitialProps ({req}) { | |
return req | |
? { from: 'server' } // 서버에서 실행 할 시 | |
: { from: 'client '} // 클라이언트에서 실행 할 시 | |
} | |
render() { | |
return ( | |
<Layout> | |
{this.props.from} 에서 실행이 되었어요. | |
</Layout> | |
); | |
} | |
} | |
export default SSRTest; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment