mirror of
https://github.com/zhigang1992/devhub.git
synced 2026-06-10 23:39:22 +08:00
Fix missing key warning
This commit is contained in:
@@ -90,6 +90,7 @@ export const CommentRow = React.memo((props: CommentRowProps) => {
|
||||
]}
|
||||
>
|
||||
{parseTextWithEmojisToReactComponents(body, {
|
||||
key: `comment-text-${body}`,
|
||||
imageProps: {
|
||||
style: {
|
||||
width: 14,
|
||||
|
||||
@@ -122,6 +122,7 @@ export function Label(props: LabelProps) {
|
||||
)}
|
||||
{typeof children === 'string'
|
||||
? parseTextWithEmojisToReactComponents(children, {
|
||||
key: `label-text-${children}`,
|
||||
imageProps: {
|
||||
style: {
|
||||
width: small ? 10 : 11,
|
||||
|
||||
@@ -269,6 +269,7 @@ export const AdvancedSettingsModal = React.memo(
|
||||
installation.htmlUrl
|
||||
) && (
|
||||
<View
|
||||
key={`github-installation-${installation.id}`}
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Omit } from '@devhub/core'
|
||||
import _ from 'lodash'
|
||||
import React from 'react'
|
||||
import React, { Fragment } from 'react'
|
||||
import { Image, ImageProps } from 'react-native'
|
||||
|
||||
const emojis = {
|
||||
@@ -1538,10 +1538,11 @@ function surrogatePairToCodepoint(lead: number, trail: number) {
|
||||
}
|
||||
|
||||
export interface EmojiParseOptions {
|
||||
after?: React.ReactNode
|
||||
alt?: string
|
||||
before?: React.ReactNode
|
||||
after?: React.ReactNode
|
||||
imageProps?: Omit<ImageProps, 'source'>
|
||||
key: string
|
||||
}
|
||||
|
||||
function getComponent(
|
||||
@@ -1625,5 +1626,7 @@ export function parseTextWithEmojisToReactComponents(
|
||||
if (typeof item !== 'string') return item
|
||||
return parseTextWithEmojisToReactComponents_2(item, options)
|
||||
}),
|
||||
)
|
||||
).map((item, index) => (
|
||||
<Fragment key={`${options.key}-${index}`}>{item}</Fragment>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user