Bug 1492863 - Fix react warnings in aboutdebugging-new;r=daisuke

Differential Revision: https://phabricator.services.mozilla.com/D6400

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2018-09-25 11:04:58 +00:00
Родитель 8648acbeb0
Коммит 17903b38b8
7 изменённых файлов: 20 добавлений и 15 удалений

Просмотреть файл

@ -27,8 +27,8 @@ class App extends PureComponent {
dispatch: PropTypes.func.isRequired,
messageContexts: PropTypes.arrayOf(PropTypes.object).isRequired,
networkLocations: PropTypes.arrayOf(PropTypes.string).isRequired,
runtimes: PropTypes.array.isRequired,
selectedPage: PropTypes.string.isRequired,
runtimes: PropTypes.object.isRequired,
selectedPage: PropTypes.string,
};
}

Просмотреть файл

@ -26,7 +26,7 @@ class ConnectPage extends PureComponent {
dispatch: PropTypes.func.isRequired,
// Provided by wrapping the component with FluentReact.withLocalization.
getString: PropTypes.func.isRequired,
networkLocations: PropTypes.arrayOf(PropTypes.object).isRequired,
networkLocations: PropTypes.arrayOf(PropTypes.string).isRequired,
};
}

Просмотреть файл

@ -22,7 +22,8 @@ class ConnectSteps extends PureComponent {
},
this.props.steps.map(step => dom.li(
{
className: "connect-page__step"
className: "connect-page__step",
key: step,
},
step)
)

Просмотреть файл

@ -17,7 +17,7 @@ class NetworkLocationsList extends PureComponent {
static get propTypes() {
return {
dispatch: PropTypes.func.isRequired,
networkLocations: PropTypes.arrayOf(PropTypes.object).isRequired,
networkLocations: PropTypes.arrayOf(PropTypes.string).isRequired,
};
}
@ -27,7 +27,8 @@ class NetworkLocationsList extends PureComponent {
this.props.networkLocations.map(location =>
dom.li(
{
className: "connect-page__network-location js-network-location"
className: "connect-page__network-location js-network-location",
key: location,
},
dom.span(
{

Просмотреть файл

@ -45,12 +45,12 @@ class ExtensionDetail extends PureComponent {
uuid,
Localized(
{
id: "about-debugging-extension-manifest-link"
id: "about-debugging-extension-manifest-link",
key: "manifest",
},
dom.a(
{
className: "extension-detail__manifest",
key: "manifest",
href: manifestURL,
target: "_blank",
},

Просмотреть файл

@ -24,8 +24,8 @@ class Sidebar extends PureComponent {
static get propTypes() {
return {
dispatch: PropTypes.func.isRequired,
runtimes: PropTypes.array.isRequired,
selectedPage: PropTypes.string.isRequired,
runtimes: PropTypes.object.isRequired,
selectedPage: PropTypes.string,
};
}
@ -61,20 +61,24 @@ class Sidebar extends PureComponent {
dispatch,
icon: GLOBE_ICON,
isSelected: selectedPage === pageId,
key: pageId,
name: runtime.id,
runtimeId: runtime.id,
selectable: runtimeHasClient,
});
}),
...runtimes.usbRuntimes.map(runtime =>
SidebarItem({
id: `usb-${ runtime.id }`,
...runtimes.usbRuntimes.map(runtime => {
const pageId = "usb-" + runtime.id;
return SidebarItem({
id: pageId,
dispatch,
icon: USB_ICON,
isSelected: false,
key: pageId,
name: runtime.name,
selectable: false,
})),
});
}),
];
}

Просмотреть файл

@ -24,7 +24,6 @@ class SidebarItem extends PureComponent {
name: PropTypes.string.isRequired,
runtimeId: PropTypes.string,
selectable: PropTypes.bool.isRequired,
type: PropTypes.string.isRequired,
};
}