mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
a35e747e24
* Added Sentry example * Code style fixes * Fixes docs + removed demo DSN + send error to comp
26 lines
484 B
JavaScript
26 lines
484 B
JavaScript
import React from 'react'
|
|
import withSentry from '../components/withSentry'
|
|
|
|
class Index extends React.Component {
|
|
static getInitialProps (context) {
|
|
const { isServer } = context
|
|
return { isServer }
|
|
}
|
|
|
|
onClickHandler () {
|
|
throw new Error('woops')
|
|
}
|
|
|
|
render () {
|
|
return (
|
|
<div>
|
|
<h2>Index page</h2>
|
|
|
|
<button onClick={this.onClickHandler.bind(this)}>Click to raise error</button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default withSentry(Index)
|