Fix render issues that occurs when jumpToLine isn't provided

This commit is contained in:
Kyle Shockey
2017-04-04 17:45:37 -07:00
parent 96f855ece7
commit 0ee0236666
5 changed files with 55 additions and 52 deletions

View File

@@ -68,7 +68,7 @@ const ThrownErrorItem = ( { error, jumpToLine } ) => {
{ error.get("message") }
</span>
<div>
{ errorLine ? <a onClick={jumpToLine.bind(null, errorLine)}>Jump to line { errorLine }</a> : null }
{ errorLine && jumpToLine ? <a onClick={jumpToLine.bind(null, errorLine)}>Jump to line { errorLine }</a> : null }
</div>
</div>
}
@@ -106,6 +106,10 @@ ThrownErrorItem.propTypes = {
jumpToLine: PropTypes.func
}
ThrownErrorItem.defaultProps = {
jumpToLine: null
}
SpecErrorItem.propTypes = {
error: PropTypes.object.isRequired,
jumpToLine: PropTypes.func