[redux-devtools-trace-monitor] StackTraceTab: Make openFile prop for custom openFile function (#458)

This commit is contained in:
Jhen-Jie Hong 2019-02-07 07:58:51 +08:00 committed by Mihail Diordiev
parent eef342fb64
commit 2be2f652d8
2 changed files with 10 additions and 2 deletions

View File

@ -7,6 +7,9 @@ import openFile from './openFile';
const rootStyle = {padding: '5px 10px'};
export default class StackTraceTab extends Component {
static defaultProps = {
openFile
}
constructor(props) {
super(props);
@ -78,7 +81,7 @@ export default class StackTraceTab extends Component {
const originalStackFrame = parsedFramesNoSourcemaps[frameIndex];
console.log("Original stack frame: ", originalStackFrame);
*/
openFile(fileName, lineNumber, matchingStackFrame);
this.props.openFile(fileName, lineNumber, matchingStackFrame);
}
}
}

View File

@ -33,6 +33,7 @@ exports[`StackTraceTab component should render the link to docs 1`] = `
},
}
}
openFile={[Function]}
>
<div
style={
@ -54,7 +55,9 @@ exports[`StackTraceTab component should render the link to docs 1`] = `
`;
exports[`StackTraceTab component should render with no props 1`] = `
<StackTraceTab>
<StackTraceTab
openFile={[Function]}
>
<div
style={
Object {
@ -116,6 +119,7 @@ exports[`StackTraceTab component should render with props, but without stack 1`]
},
}
}
openFile={[Function]}
>
<div
style={
@ -178,6 +182,7 @@ exports[`StackTraceTab component should render with trace stack 1`] = `
},
}
}
openFile={[Function]}
>
<div
style={