From 5bca64a03a10c9d749d834d36a3943304ec700b9 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 1 Aug 2021 12:01:36 +0200 Subject: [PATCH] Renamed widget type option --- src/editor/widgets/index.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/widgets/index.jsx b/src/editor/widgets/index.jsx index ffa8508..3a6fb6f 100644 --- a/src/editor/widgets/index.jsx +++ b/src/editor/widgets/index.jsx @@ -59,14 +59,14 @@ const isReactComponent = component => { */ export const getWidget = arg => { - const instantiate = (widget, config, type) => { + const instantiate = (widget, config, force) => { // Check if user forced explicit type if (typeof widget === 'string' || widget instanceof String) { // Built-in return React.createElement(BUILTIN_WIDGETS[widget], config); } else { // Plugin - if (type?.toLowerCase() === 'react') { + if (force?.toLowerCase() === 'react') { return React.createElement(widget, config); } else { // Auto-detect @@ -83,8 +83,8 @@ export const getWidget = arg => { // First, check 'top-level' vs. 'nested object' case if (arg.widget) { - const { widget, type, ...config } = arg; - return instantiate(widget, config, type); + const { widget, force, ...config } = arg; + return instantiate(widget, config, force); } else { // No object with args -> instantiate arg directly return instantiate(arg);