Fix missing react key error

pull/449/head
Beaudan Brown 6 years ago
parent 87e57af090
commit ba72f55b03

@ -25,10 +25,12 @@ export class Linkify extends React.Component<Props> {
public render() { public render() {
const { text, renderNonLink, isRss } = this.props; const { text, renderNonLink, isRss } = this.props;
const results: Array<any> = []; const results: Array<any> = [];
let count = 1;
if (isRss && text.indexOf('</') !== -1) { if (isRss && text.indexOf('</') !== -1) {
results.push( results.push(
<div <div
key={count++}
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: text __html: text
.replace( .replace(
@ -46,7 +48,6 @@ export class Linkify extends React.Component<Props> {
const matchData = linkify.match(text) || []; const matchData = linkify.match(text) || [];
let last = 0; let last = 0;
let count = 1;
// We have to do this, because renderNonLink is not required in our Props object, // We have to do this, because renderNonLink is not required in our Props object,
// but it is always provided via defaultProps. // but it is always provided via defaultProps.

Loading…
Cancel
Save