import React from 'react' import Link from 'next/link' class Index extends React.Component { static getInitialProps ({ query, req }) { if (query.raiseError) { throw new Error('Error in getInitialProps') } } state = { raiseError: false } componentDidUpdate () { if (this.state.raiseErrorInUpdate) { throw new Error('Error in componentDidUpdate') } } raiseErrorInUpdate = () => this.setState({ raiseErrorInUpdate: '1' }) raiseErrorInRender = () => this.setState({ raiseErrorInRender: '1' }) render () { if (this.state.raiseErrorInRender) { throw new Error('Error in render') } return (
) } } export default Index