Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Silence warning about missing key.#30

Open
alexwilson wants to merge 1 commit intobradleyboy:masterfrom
alexwilson:patch-1
Open

Silence warning about missing key.#30
alexwilson wants to merge 1 commit intobradleyboy:masterfrom
alexwilson:patch-1

Conversation

@alexwilson
Copy link
Copy Markdown

No description provided.

{children.split(' ').map((word) => {
const arr = word.split('');
return (<span><strong>{arr.shift()}</strong>{arr.join('')} </span>);
let firstLetter = arr.shift();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antoligy Sorry for the late reply here, but how about:

const [firstLetter, ...otherLetters] = word.split('');
return (<span key={firstLetter}><strong>{firstLetter}</strong>{otherLetters.join('')} </span>);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants