From df1e6a55c4829d762939d29d4bfec6d50107e4fa Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 10 Jun 2016 10:22:04 +0200 Subject: [PATCH] Remove displayName declaration from ProxyHandler's component --- js/components/ascribe_routes/proxy_handler.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_routes/proxy_handler.js b/js/components/ascribe_routes/proxy_handler.js index e8d9bf6d..fc0d7ffa 100644 --- a/js/components/ascribe_routes/proxy_handler.js +++ b/js/components/ascribe_routes/proxy_handler.js @@ -77,9 +77,10 @@ export function AuthRedirect({ to, when }) { */ export function ProxyHandler(...redirectFunctions) { return (Component) => { - const ProxyHandlerComponent = React.createClass({ - displayName: 'ProxyHandler', - + // Don't worry about shadowing the HOC here; using a declaration like this allows + // babel-plugin-react-display-name to automatically generate the displayName. + // eslint-disable-next-line no-shadow + const ProxyHandler = React.createClass({ propTypes: { // Injected through HOCs currentUser: currentUserShape.isRequired, @@ -120,7 +121,7 @@ export function ProxyHandler(...redirectFunctions) { } }); - return withContext(ProxyHandlerComponent, + return withContext(ProxyHandler, 'currentUser', 'isLoggedIn', 'location',