1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Fix a propType warning on the Flask welcome screen (#13224) (#13246)

The first page of the Flask onboarding was causing a propType warning
to appear in the console. It was caused by the array of React Fragments
used to construct the ASCII fox; they were missing the `key` prop.

These fragments are static content, so React doesn't really need to
worry about what to do in the event they are re-ordered. The array
index has been used as the key to silence the warning.
This commit is contained in:
Mark Stacey 2022-01-10 13:31:37 -03:30 committed by GitHub
parent ac5d06e4e3
commit 57e83ff82a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,16 @@
import React, { useContext } from 'react';
import React, { Fragment, useContext } from 'react';
import { useHistory } from 'react-router-dom';
import PropTypes from 'prop-types';
import { I18nContext } from '../../../../contexts/i18n';
import Button from '../../../ui/button';
function lineBreaksToBr(source) {
return source.split('\n').map((value) => {
return source.split('\n').map((value, index) => {
return (
<>
<Fragment key={index}>
{value}
<br />
</>
</Fragment>
);
});
}