From 74f2d0a36021cf22195a699d5190017fbb64fa91 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 3 Jul 2018 14:54:43 +0100 Subject: [PATCH] Use inline class field for PropTypes --- src/components/views/elements/PersistedElement.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 389a1458d2..23dea3499c 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -49,6 +49,14 @@ const PE_Z_INDEX = 5000; * bounding rect as the parent of PE. */ export default class PersistedElement extends React.Component { + + static propTypes = { + // Unique identifier for this PersistedElement instance + // Any PersistedElements with the same persistKey will use + // the same DOM container. + persistKey: PropTypes.string.isRequired, + }; + constructor() { super(); this.collectChildContainer = this.collectChildContainer.bind(this); @@ -110,10 +118,3 @@ export default class PersistedElement extends React.Component { return
; } } - -PersistedElement.propTypes = { - // Unique identifier for this PersistedElement instance - // Any PersistedElements with the same persistKey will use - // the same DOM container. - persistKey: PropTypes.string.isRequired, -};