Fix more react warnings
Summary: Fixing random React errors as I encountered them. Reviewed By: jknoxville Differential Revision: D18397950 fbshipit-source-id: cb73fcd6cd9aac2cd53c982e5a58760be12a10ca
This commit is contained in:
committed by
Facebook Github Bot
parent
19937c4b83
commit
93655d39b8
@@ -163,35 +163,37 @@ export default class Popover extends PureComponent<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return [
|
return (
|
||||||
<Anchor src="./anchor.svg" key="anchor" />,
|
<>
|
||||||
<PopoverContainer innerRef={this._setRef} key="popup">
|
<Anchor src="./anchor.svg" key="anchor" />
|
||||||
{this.props.sections.map(section => {
|
<PopoverContainer innerRef={this._setRef} key="popup">
|
||||||
if (section.items.length > 0) {
|
{this.props.sections.map(section => {
|
||||||
return (
|
if (section.items.length > 0) {
|
||||||
<Section key={section.title}>
|
return (
|
||||||
<Heading>{section.title}</Heading>
|
<Section key={section.title}>
|
||||||
{section.items.map(item => (
|
<Heading>{section.title}</Heading>
|
||||||
<PopoverItem key={item.title}>
|
{section.items.map(item => (
|
||||||
<ItemImage>{item.icon}</ItemImage>
|
<PopoverItem key={item.title}>
|
||||||
<ItemContent>
|
<ItemImage>{item.icon}</ItemImage>
|
||||||
<ItemTitle>{item.title}</ItemTitle>
|
<ItemContent>
|
||||||
<ItemSubtitle>{item.subtitle}</ItemSubtitle>
|
<ItemTitle>{item.title}</ItemTitle>
|
||||||
</ItemContent>
|
<ItemSubtitle>{item.subtitle}</ItemSubtitle>
|
||||||
{item.onClick && (
|
</ItemContent>
|
||||||
<Action onClick={item.onClick} compact={true}>
|
{item.onClick && (
|
||||||
Run
|
<Action onClick={item.onClick} compact={true}>
|
||||||
</Action>
|
Run
|
||||||
)}
|
</Action>
|
||||||
</PopoverItem>
|
)}
|
||||||
))}
|
</PopoverItem>
|
||||||
</Section>
|
))}
|
||||||
);
|
</Section>
|
||||||
} else {
|
);
|
||||||
return null;
|
} else {
|
||||||
}
|
return null;
|
||||||
})}
|
}
|
||||||
</PopoverContainer>,
|
})}
|
||||||
];
|
</PopoverContainer>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,10 @@ export default class ShareSheetExportUrl extends Component<Props, State> {
|
|||||||
used to share with other Flipper users. Opening it will
|
used to share with other Flipper users. Opening it will
|
||||||
import the data from your trace.
|
import the data from your trace.
|
||||||
</InfoText>
|
</InfoText>
|
||||||
<Copy value={(result as DataExportResult).flipperUrl} />
|
<Copy
|
||||||
|
value={(result as DataExportResult).flipperUrl}
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
<InfoText>
|
<InfoText>
|
||||||
When sharing your Flipper link, consider that the captured
|
When sharing your Flipper link, consider that the captured
|
||||||
data might contain sensitve information like access tokens
|
data might contain sensitve information like access tokens
|
||||||
|
|||||||
@@ -93,14 +93,17 @@ export default class Popover extends PureComponent<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return [
|
return (
|
||||||
<Anchor src="./anchor.svg" key="anchor" />,
|
<>
|
||||||
<PopoverContainer
|
<Anchor src="./anchor.svg" key="anchor" />
|
||||||
innerRef={this._setRef}
|
<PopoverContainer
|
||||||
key="popup"
|
innerRef={this._setRef}
|
||||||
opts={this.props.forceOpts || {}}>
|
key="popup"
|
||||||
{this.props.children}
|
opts={this.props.forceOpts || {}}>
|
||||||
</PopoverContainer>,
|
{this.props.children}
|
||||||
];
|
</PopoverContainer>
|
||||||
|
,
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ class PartialHighlight extends PureComponent<{
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {highlighted, content, selected} = this.props;
|
const {highlighted, content, selected} = this.props;
|
||||||
let renderedValue;
|
|
||||||
if (
|
if (
|
||||||
content &&
|
content &&
|
||||||
highlighted != null &&
|
highlighted != null &&
|
||||||
@@ -148,19 +147,18 @@ class PartialHighlight extends PureComponent<{
|
|||||||
const before = content.substring(0, highlightStart);
|
const before = content.substring(0, highlightStart);
|
||||||
const match = content.substring(highlightStart, highlightEnd);
|
const match = content.substring(highlightStart, highlightEnd);
|
||||||
const after = content.substring(highlightEnd);
|
const after = content.substring(highlightEnd);
|
||||||
renderedValue = [
|
return (
|
||||||
<span>
|
<span>
|
||||||
{before}
|
{before}
|
||||||
<PartialHighlight.HighlightedText selected={selected}>
|
<PartialHighlight.HighlightedText selected={selected}>
|
||||||
{match}
|
{match}
|
||||||
</PartialHighlight.HighlightedText>
|
</PartialHighlight.HighlightedText>
|
||||||
{after}
|
{after}
|
||||||
</span>,
|
</span>
|
||||||
];
|
);
|
||||||
} else {
|
} else {
|
||||||
renderedValue = <span>{content}</span>;
|
return <span>{content}</span>;
|
||||||
}
|
}
|
||||||
return renderedValue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user