From 15c0e0f57be3cbcb9942da2ba15a90d83634a582 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Thu, 19 Jul 2018 21:31:03 +0200 Subject: [PATCH] Fix isStateLess() Stateless components like e.g. this one https://github.com/dmtrKovalenko/material-ui-pickers/blob/master/lib/src/_shared/WithUtils.jsx#L5 don't even have a prototype because they are plain functions. So the old `isStateLess()` implementation failed with "Uncaught TypeError: Cannot read property 'render' of undefined." --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 5d3084d..790268e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1 +1 @@ -export const isStateLess = Component => !Component.prototype.render +export const isStateLess = Component => !Component.prototype || !Component.prototype.render