[redux-devtools-trace-monitor] StackTraceTab: Make openFile prop for custom openFile function

This commit is contained in:
jhen 2019-02-03 10:59:31 +08:00
parent 0f0994bdef
commit e92ee0662d
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={