-
-
Couldn't load subscription status.
- Fork 27.1k
Updated react-error-overlay to latest Flow (0.54.0) #3065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6deaffb
ef9e90f
15129c9
a784af7
a910670
fc7c742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ import CodeBlock from './StackFrameCodeBlock'; | |
| import { getPrettyURL } from '../utils/getPrettyURL'; | ||
| import { darkGray } from '../styles'; | ||
|
|
||
| import type { StackFrame as StackFrameType } from '../utils/stack-frame'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here (and below). |
||
|
|
||
| const linkStyle = { | ||
| fontSize: '0.9em', | ||
| marginBottom: '0.9em', | ||
|
|
@@ -43,7 +45,19 @@ const toggleStyle = { | |
| lineHeight: '1.5', | ||
| }; | ||
|
|
||
| class StackFrame extends Component { | ||
| type Props = {| | ||
| frame: StackFrameType, | ||
| launchEditorEndpoint: ?string, | ||
| contextSize: number, | ||
| critical: boolean, | ||
| showCode: boolean, | ||
| |}; | ||
|
|
||
| type State = {| | ||
| compiled: boolean, | ||
| |}; | ||
|
|
||
| class StackFrame extends Component<Props, State> { | ||
| state = { | ||
| compiled: false, | ||
| }; | ||
|
|
@@ -74,7 +88,7 @@ class StackFrame extends Component { | |
| } | ||
|
|
||
| openInEditor = () => { | ||
| if (!this.canOpenInEditor()) { | ||
| if (!this.props.launchEditorEndpoint) { | ||
|
||
| return; | ||
| } | ||
| const { | ||
|
|
@@ -90,7 +104,7 @@ class StackFrame extends Component { | |
| ).then(() => {}, () => {}); | ||
| }; | ||
|
|
||
| onKeyDown = (e: SyntheticKeyboardEvent) => { | ||
| onKeyDown = (e: SyntheticKeyboardEvent<>) => { | ||
| if (e.key === 'Enter') { | ||
| this.openInEditor(); | ||
| } | ||
|
|
@@ -155,9 +169,7 @@ class StackFrame extends Component { | |
| const canOpenInEditor = this.canOpenInEditor(); | ||
| return ( | ||
| <div> | ||
| <div> | ||
| {functionName} | ||
| </div> | ||
| <div>{functionName}</div> | ||
| <div style={linkStyle}> | ||
| <a | ||
| style={canOpenInEditor ? anchorStyle : null} | ||
|
|
@@ -168,7 +180,7 @@ class StackFrame extends Component { | |
| {url} | ||
| </a> | ||
| </div> | ||
| {codeBlockProps && | ||
| {codeBlockProps && ( | ||
| <span> | ||
| <a | ||
| onClick={canOpenInEditor ? this.openInEditor : null} | ||
|
|
@@ -179,7 +191,8 @@ class StackFrame extends Component { | |
| <button style={toggleStyle} onClick={this.toggleCompiled}> | ||
| {'View ' + (compiled ? 'source' : 'compiled')} | ||
| </button> | ||
| </span>} | ||
| </span> | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||




There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please always add newline before
import types?