From fc4926600ae19a07f227020479fb7468e2b09a66 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 5 Dec 2019 10:42:20 +0000 Subject: [PATCH] Fix propTypes declaration With this version of babel (via babel-eslint), eslint now fails with a somewhat confusing, "Unexpected reserved type number" (from the flow plugin...) if you get this wrong. --- src/components/structures/ContextMenu.js | 2 +- src/components/views/elements/InteractiveTooltip.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/ContextMenu.js b/src/components/structures/ContextMenu.js index 1087f48b28..455deb4708 100644 --- a/src/components/structures/ContextMenu.js +++ b/src/components/structures/ContextMenu.js @@ -47,7 +47,7 @@ const ARIA_MENU_ITEM_ROLES = new Set(["menuitem", "menuitemcheckbox", "menuitemr // all options inside the menu should be of role=menuitem/menuitemcheckbox/menuitemradiobutton and have tabIndex={-1} // this will allow the ContextMenu to manage its own focus using arrow keys as per the ARIA guidelines. export class ContextMenu extends React.Component { - propTypes: { + static propTypes = { top: PropTypes.number, bottom: PropTypes.number, left: PropTypes.number, diff --git a/src/components/views/elements/InteractiveTooltip.js b/src/components/views/elements/InteractiveTooltip.js index 0bb356c5ba..7f5f24a094 100644 --- a/src/components/views/elements/InteractiveTooltip.js +++ b/src/components/views/elements/InteractiveTooltip.js @@ -90,7 +90,7 @@ function isInLowerLeftHalf(x, y, rect) { * tooltip along one edge of the target. */ export default class InteractiveTooltip extends React.Component { - propTypes: { + static propTypes = { // Content to show in the tooltip content: PropTypes.node.isRequired, // Function to call when visibility of the tooltip changes