@recogito/recogito-client-core
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "@recogito/recogito-client-core", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Core functions, classes and components for RecogitoJS", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -6,2 +6,9 @@ import React from 'react'; | ||
/** | ||
* We'll add React to the global window, so that | ||
* plugins can use it without re-bundling. Also, | ||
* without this, hooks won't work! | ||
*/ | ||
window.React = React; | ||
/** Standard widgets included by default **/ | ||
@@ -22,3 +29,3 @@ const BUILTIN_WIDGETS = { | ||
const isClassComponent = component => | ||
typeof component === 'function' && !!component.prototype.isReactComponent; | ||
typeof component === 'function' && !!component.prototype?.isReactComponent; | ||
@@ -32,3 +39,4 @@ const isFunctionComponent = component => | ||
String(component).match(/return .+\(['|"].+['|"],\s*\{/g) || | ||
String(component).match(/return .+preact_compat/) | ||
String(component).match(/return .+preact_compat/) || | ||
String(component).match(/return .+\.createElement/g) | ||
); | ||
@@ -35,0 +43,0 @@ |
62621
1280